📄 notepad_plus_msgs.h
字号:
//wParam: Position of document
//lParam: View to use, 0 = Main, 1 = Secondary
//Returns 0 if invalid
#define NPPM_GETCURRENTBUFFERID (NPPMSG + 60)
//Returns active Buffer
#define NPPM_RELOADBUFFERID (NPPMSG + 61)
//Reloads Buffer
//wParam: Buffer to reload
//lParam: 0 if no alert, else alert
#define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64)
//wParam: BufferID to get LangType from
//lParam: 0
//Returns as int, see LangType. -1 on error
#define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65)
//wParam: BufferID to set LangType of
//lParam: LangType
//Returns TRUE on success, FALSE otherwise
//use int, see LangType for possible values
//L_USER and L_EXTERNAL are not supported
#define NPPM_GETBUFFERENCODING (NPPMSG + 66)
//wParam: BufferID to get encoding from
//lParam: 0
//returns as int, see UniMode. -1 on error
#define NPPM_SETBUFFERENCODING (NPPMSG + 67)
//wParam: BufferID to set encoding of
//lParam: format
//Returns TRUE on success, FALSE otherwise
//use int, see UniMode
//Can only be done on new, unedited files
#define NPPM_GETBUFFERFORMAT (NPPMSG + 68)
//wParam: BufferID to get format from
//lParam: 0
//returns as int, see formatType. -1 on error
#define NPPM_SETBUFFERFORMAT (NPPMSG + 69)
//wParam: BufferID to set format of
//lParam: format
//Returns TRUE on success, FALSE otherwise
//use int, see formatType
/*
#define NPPM_ADDREBAR (NPPMSG + 57)
// BOOL NPPM_ADDREBAR(0, REBARBANDINFO *)
// Returns assigned ID in wID value of struct pointer
#define NPPM_UPDATEREBAR (NPPMSG + 58)
// BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *)
//Use ID assigned with NPPM_ADDREBAR
#define NPPM_REMOVEREBAR (NPPMSG + 59)
// BOOL NPPM_ADDREBAR(INT ID, 0)
//Use ID assigned with NPPM_ADDREBAR
*/
#define NPPM_HIDETOOLBAR (NPPMSG + 70)
// BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot)
// if hideOrNot is set as TRUE then tool bar will be hidden
// otherwise it'll be shown.
// return value : the old status value
#define NPPM_ISTOOLBARHIDDEN (NPPMSG + 71)
// BOOL NPPM_ISTOOLBARHIDDEN(0, 0)
// returned value : TRUE if tool bar is hidden, otherwise FALSE
#define NPPM_HIDEMENU (NPPMSG + 72)
// BOOL NPPM_HIDEMENU(0, BOOL hideOrNot)
// if hideOrNot is set as TRUE then menu will be hidden
// otherwise it'll be shown.
// return value : the old status value
#define NPPM_ISMENUHIDDEN (NPPMSG + 73)
// BOOL NPPM_ISMENUHIDDEN(0, 0)
// returned value : TRUE if menu is hidden, otherwise FALSE
#define NPPM_HIDESTATUSBAR (NPPMSG + 74)
// BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot)
// if hideOrNot is set as TRUE then STATUSBAR will be hidden
// otherwise it'll be shown.
// return value : the old status value
#define NPPM_ISSTATUSBARHIDDEN (NPPMSG + 75)
// BOOL NPPM_ISSTATUSBARHIDDEN(0, 0)
// returned value : TRUE if STATUSBAR is hidden, otherwise FALSE
#define NPPM_GETSHORTCUTBYCMDID (NPPMSG + 76)
// BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk)
// get your plugin command current mapped shortcut into sk via cmdID
// You may need it after getting NPPN_READY notification
// returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE
#define NPPM_DOOPEN (NPPMSG + 77)
// BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open)
// fullPathName2Open indicates the full file path name to be opened.
// The return value is TRUE (1) if the operation is successful, otherwise FALSE (0).
#define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
#define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME)
#define NPPM_GETNAMEPART (RUNCOMMAND_USER + NAME_PART)
#define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART)
#define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD)
#define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY)
// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
// where str is the allocated TCHAR array,
// strLen is the allocated array size
// The return value is TRUE when get generic_string operation success
// Otherwise (allocated array size is too small) FALSE
#define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE)
// INT NPPM_GETCURRENTLINE(0, 0)
// return the caret current position line
#define NPPM_GETCURRENTCOLUMN (RUNCOMMAND_USER + CURRENT_COLUMN)
// INT NPPM_GETCURRENTCOLUMN(0, 0)
// return the caret current position column
#define VAR_NOT_RECOGNIZED 0
#define FULL_CURRENT_PATH 1
#define CURRENT_DIRECTORY 2
#define FILE_NAME 3
#define NAME_PART 4
#define EXT_PART 5
#define CURRENT_WORD 6
#define NPP_DIRECTORY 7
#define CURRENT_LINE 8
#define CURRENT_COLUMN 9
// Notification code
#define NPPN_FIRST 1000
#define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done.
//scnNotification->nmhdr.code = NPPN_READY;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;
#define NPPN_TBMODIFICATION (NPPN_FIRST + 2) // To notify plugins that toolbar icons can be registered
//scnNotification->nmhdr.code = NPPN_TB_MODIFICATION;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;
#define NPPN_FILEBEFORECLOSE (NPPN_FIRST + 3) // To notify plugins that the current file is about to be closed
//scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;
#define NPPN_FILEOPENED (NPPN_FIRST + 4) // To notify plugins that the current file is just opened
//scnNotification->nmhdr.code = NPPN_FILEOPENED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;
#define NPPN_FILECLOSED (NPPN_FIRST + 5) // To notify plugins that the current file is just closed
//scnNotification->nmhdr.code = NPPN_FILECLOSED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;
#define NPPN_FILEBEFOREOPEN (NPPN_FIRST + 6) // To notify plugins that the current file is about to be opened
//scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;
#define NPPN_FILEBEFORESAVE (NPPN_FIRST + 7) // To notify plugins that the current file is about to be saved
//scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;
#define NPPN_FILESAVED (NPPN_FIRST + 8) // To notify plugins that the current file is just saved
//scnNotification->nmhdr.code = NPPN_FILECLOSED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = BufferID;
#define NPPN_SHUTDOWN (NPPN_FIRST + 9) // To notify plugins that Notepad++ is about to be shutdowned.
//scnNotification->nmhdr.code = NPPN_SHUTDOWN;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = 0;
#define NPPN_BUFFERACTIVATED (NPPN_FIRST + 10) // To notify plugins that a buffer was activated (put to foreground).
//scnNotification->nmhdr.code = NPPN_BUFFERACTIVATED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = activatedBufferID;
#define NPPN_LANGCHANGED (NPPN_FIRST + 11) // To notify plugins that the language in the current doc is just changed.
//scnNotification->nmhdr.code = NPPN_LANGCHANGED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = currentBufferID;
#define NPPN_WORDSTYLESUPDATED (NPPN_FIRST + 12) // To notify plugins that user initiated a WordStyleDlg change.
//scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = currentBufferID;
#define NPPN_SHORTCUTREMAPPED (NPPN_FIRST + 13) // To notify plugins that plugin command shortcut is remapped.
//scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED;
//scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer;
//scnNotification->nmhdr.idFrom = cmdID;
//where ShortcutKeyStructurePointer is pointer of struct ShortcutKey:
//struct ShortcutKey {
// bool _isCtrl;
// bool _isAlt;
// bool _isShift;
// UCHAR _key;
//};
#endif //NOTEPAD_PLUS_MSGS_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -