1 // This file is part of Notepad++ project
2 // Copyright (C)2020 Don HO <don.h@free.fr>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either
7 // version 2 of the License, or (at your option) any later version.
8 //
9 // Note that the GPL places important restrictions on "derived works", yet
10 // it does not provide a detailed definition of that term.  To avoid
11 // misunderstandings, we consider an application to constitute a
12 // "derivative work" for the purpose of this license if it does any of the
13 // following:
14 // 1. Integrates source code from Notepad++.
15 // 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
16 //    installer, such as those produced by InstallShield.
17 // 3. Links to a library or executes a program that does any of the above.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 /**
28  *
29  *
30  * License: GPL-2.0 or later
31  */
32 module npp_api.powereditor.misc.pluginsmanager.notepad_plus_msgs;
33 
34 
35 private static import core.stdc.config;
36 private static import core.sys.windows.windef;
37 private static import core.sys.windows.winnt;
38 private static import core.sys.windows.winuser;
39 
40 enum LangType
41 {
42 	L_TEXT,
43 	L_PHP,
44 	L_C,
45 	L_CPP,
46 	L_CS,
47 	L_OBJC,
48 	L_JAVA,
49 	L_RC,
50 	L_HTML,
51 	L_XML,
52 	L_MAKEFILE,
53 	L_PASCAL,
54 	L_BATCH,
55 	L_INI,
56 	L_ASCII,
57 	L_USER,
58 	L_ASP,
59 	L_SQL,
60 	L_VB,
61 	L_JS,
62 	L_CSS,
63 	L_PERL,
64 	L_PYTHON,
65 	L_LUA,
66 	L_TEX,
67 	L_FORTRAN,
68 	L_BASH,
69 	L_FLASH,
70 	L_NSIS,
71 	L_TCL,
72 	L_LISP,
73 	L_SCHEME,
74 	L_ASM,
75 	L_DIFF,
76 	L_PROPS,
77 	L_PS,
78 	L_RUBY,
79 	L_SMALLTALK,
80 	L_VHDL,
81 	L_KIX,
82 	L_AU3,
83 	L_CAML,
84 	L_ADA,
85 	L_VERILOG,
86 	L_MATLAB,
87 	L_HASKELL,
88 	L_INNO,
89 	L_SEARCHRESULT,
90 	L_CMAKE,
91 	L_YAML,
92 	L_COBOL,
93 	L_GUI4CLI,
94 	L_D,
95 	L_POWERSHELL,
96 	L_R,
97 	L_JSP,
98 	L_COFFEESCRIPT,
99 	L_JSON,
100 	L_JAVASCRIPT,
101 	L_FORTRAN_77,
102 
103 	L_BAANC,
104 	L_SREC,
105 	L_IHEX,
106 	L_TEHEX,
107 	L_SWIFT,
108 	L_ASN1,
109 	L_AVS,
110 	L_BLITZBASIC,
111 	L_PUREBASIC,
112 	L_FREEBASIC,
113 	L_CSOUND,
114 	L_ERLANG,
115 	L_ESCRIPT,
116 	L_FORTH,
117 	L_LATEX,
118 	L_MMIXAL,
119 	L_NIMROD,
120 	L_NNCRONTAB,
121 	L_OSCRIPT,
122 	L_REBOL,
123 	L_REGISTRY,
124 	L_RUST,
125 	L_SPICE,
126 	L_TXT2TAGS,
127 	L_VISUALPROLOG,
128 
129 	// Don't use L_JS, use L_JAVASCRIPT instead
130 	// The end of enumated language type, so it should be always at the end
131 	L_EXTERNAL,
132 }
133 
134 enum winVer
135 {
136 	WV_UNKNOWN,
137 	WV_WIN32S,
138 	WV_95,
139 	WV_98,
140 	WV_ME,
141 	WV_NT,
142 	WV_W2K,
143 	WV_XP,
144 	WV_S2003,
145 	WV_XPX64,
146 	WV_VISTA,
147 	WV_WIN7,
148 	WV_WIN8,
149 	WV_WIN81,
150 	WV_WIN10,
151 }
152 
153 enum Platform
154 {
155 	PF_UNKNOWN,
156 	PF_X86,
157 	PF_X64,
158 	PF_IA64
159 }
160 
161 version (Windows):
162 
163 enum NPPMSG = core.sys.windows.winuser.WM_USER + 1000;
164 
165 enum NPPM_GETCURRENTSCINTILLA = .NPPMSG + 4;
166 enum NPPM_GETCURRENTLANGTYPE = .NPPMSG + 5;
167 enum NPPM_SETCURRENTLANGTYPE = .NPPMSG + 6;
168 
169 enum NPPM_GETNBOPENFILES = .NPPMSG + 7;
170 enum ALL_OPEN_FILES = 0;
171 enum PRIMARY_VIEW = 1;
172 enum SECOND_VIEW = 2;
173 
174 enum NPPM_GETOPENFILENAMES = .NPPMSG + 8;
175 
176 enum NPPM_MODELESSDIALOG = .NPPMSG + 12;
177 enum MODELESSDIALOGADD = 0;
178 enum MODELESSDIALOGREMOVE = 1;
179 
180 enum NPPM_GETNBSESSIONFILES = .NPPMSG + 13;
181 enum NPPM_GETSESSIONFILES = .NPPMSG + 14;
182 enum NPPM_SAVESESSION = .NPPMSG + 15;
183 enum NPPM_SAVECURRENTSESSION = .NPPMSG + 16;
184 
185 struct sessionInfo
186 {
187 	static import core.sys.windows.winnt;
188 
189 	core.sys.windows.winnt.WCHAR* sessionFilePathName;
190 	int nbFile;
191 	core.sys.windows.winnt.WCHAR** files;
192 }
193 
194 enum NPPM_GETOPENFILENAMESPRIMARY = .NPPMSG + 17;
195 enum NPPM_GETOPENFILENAMESSECOND = .NPPMSG + 18;
196 
197 enum NPPM_CREATESCINTILLAHANDLE = .NPPMSG + 20;
198 enum NPPM_DESTROYSCINTILLAHANDLE = .NPPMSG + 21;
199 enum NPPM_GETNBUSERLANG = .NPPMSG + 22;
200 
201 enum NPPM_GETCURRENTDOCINDEX = .NPPMSG + 23;
202 enum MAIN_VIEW = 0;
203 enum SUB_VIEW = 1;
204 
205 enum NPPM_SETSTATUSBAR = .NPPMSG + 24;
206 enum STATUSBAR_DOC_TYPE = 0;
207 enum STATUSBAR_DOC_SIZE = 1;
208 enum STATUSBAR_CUR_POS = 2;
209 enum STATUSBAR_EOF_FORMAT = 3;
210 enum STATUSBAR_UNICODE_TYPE = 4;
211 enum STATUSBAR_TYPING_MODE = 5;
212 
213 enum NPPM_GETMENUHANDLE = .NPPMSG + 25;
214 enum NPPPLUGINMENU = 0;
215 enum NPPMAINMENU = 1;
216 // core.sys.windows.windef.INT NPPM_GETMENUHANDLE(core.sys.windows.windef.INT menuChoice, 0)
217 // Return: menu handle (core.sys.windows.windef.HMENU) of choice (plugin menu handle or Notepad++ main menu handle)
218 
219 //ascii file to unicode
220 //int NPPM_ENCODESCI(.MAIN_VIEW / .SUB_VIEW, 0)
221 //return new unicodeMode
222 enum NPPM_ENCODESCI = .NPPMSG + 26;
223 
224 //unicode file to ascii
225 //int NPPM_DECODESCI(.MAIN_VIEW / .SUB_VIEW, 0)
226 //return old unicodeMode
227 enum NPPM_DECODESCI = .NPPMSG + 27;
228 
229 //void NPPM_ACTIVATEDOC(int view, int index2Activate)
230 enum NPPM_ACTIVATEDOC = .NPPMSG + 28;
231 
232 //void NPPM_LAUNCHFINDINFILESDLG(core.sys.windows.winnt.WCHAR* dir2Search, core.sys.windows.winnt.WCHAR* filtre)
233 enum NPPM_LAUNCHFINDINFILESDLG = .NPPMSG + 29;
234 
235 //void NPPM_DMMSHOW(0, (*tTbData).hClient)
236 enum NPPM_DMMSHOW = .NPPMSG + 30;
237 
238 //void NPPM_DMMHIDE(0, (*tTbData).hClient)
239 enum NPPM_DMMHIDE = .NPPMSG + 31;
240 
241 //void NPPM_DMMUPDATEDISPINFO(0, (*npp_api.powereditor.wincontrols.dockingwnd.docking.tTbData).hClient)
242 enum NPPM_DMMUPDATEDISPINFO = .NPPMSG + 32;
243 
244 //void NPPM_DMMREGASDCKDLG(0, &npp_api.powereditor.wincontrols.dockingwnd.docking.tTbData)
245 enum NPPM_DMMREGASDCKDLG = .NPPMSG + 33;
246 
247 //void NPPM_LOADSESSION(0, scope const core.sys.windows.winnt.WCHAR* file name)
248 enum NPPM_LOADSESSION = .NPPMSG + 34;
249 
250 //void WM_DMM_VIEWOTHERTAB(0, (*npp_api.powereditor.wincontrols.dockingwnd.docking.tTbData).pszName)
251 enum NPPM_DMMVIEWOTHERTAB = .NPPMSG + 35;
252 
253 //core.sys.windows.windef.BOOL NPPM_RELOADFILE(core.sys.windows.windef.BOOL withAlert, core.sys.windows.winnt.WCHAR* filePathName2Reload)
254 enum NPPM_RELOADFILE = .NPPMSG + 36;
255 
256 //core.sys.windows.windef.BOOL NPPM_SWITCHTOFILE(0, core.sys.windows.winnt.WCHAR* filePathName2switch)
257 enum NPPM_SWITCHTOFILE = .NPPMSG + 37;
258 
259 //core.sys.windows.windef.BOOL NPPM_SAVECURRENTFILE(0, 0)
260 enum NPPM_SAVECURRENTFILE = .NPPMSG + 38;
261 
262 //core.sys.windows.windef.BOOL NPPM_SAVEALLFILES(0, 0)
263 enum NPPM_SAVEALLFILES = .NPPMSG + 39;
264 
265 //void WM_PIMENU_CHECK(core.sys.windows.windef.UINT .funcItem[X]._cmdID, core.sys.windows.windef.TRUE/core.sys.windows.windef.FALSE)
266 enum NPPM_SETMENUITEMCHECK = .NPPMSG + 40;
267 
268 //void WM_ADDTOOLBARICON(core.sys.windows.windef.UINT .funcItem[X]._cmdID, .toolbarIcons icon)
269 enum NPPM_ADDTOOLBARICON = .NPPMSG + 41;
270 
271 struct toolbarIcons
272 {
273 	static import core.sys.windows.windef;
274 
275 	core.sys.windows.windef.HBITMAP hToolbarBmp;
276 	core.sys.windows.windef.HICON hToolbarIcon;
277 }
278 
279 //.winVer NPPM_GETWINDOWSVERSION(0, 0)
280 enum NPPM_GETWINDOWSVERSION = .NPPMSG + 42;
281 
282 //core.sys.windows.windef.HWND WM_DMM_GETPLUGINHWNDBYNAME(scope const core.sys.windows.winnt.WCHAR* windowName, scope const core.sys.windows.winnt.WCHAR* moduleName)
283 // if moduleName is core.sys.windows.windef.NULL, then return value is core.sys.windows.windef.NULL
284 // if windowName is core.sys.windows.windef.NULL, then the first found window handle which matches with the moduleName will be returned
285 enum NPPM_DMMGETPLUGINHWNDBYNAME = .NPPMSG + 43;
286 
287 //core.sys.windows.windef.BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)
288 enum NPPM_MAKECURRENTBUFFERDIRTY = .NPPMSG + 44;
289 
290 //core.sys.windows.windef.BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
291 enum NPPM_GETENABLETHEMETEXTUREFUNC = .NPPMSG + 45;
292 
293 //core.sys.windows.windef.IN NPPM_GETPLUGINSCONFIGDIR(int strLen, core.sys.windows.winnt.WCHAR* str)
294 // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user
295 // Returns the number of TCHAR copied/to copy.
296 // Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character),
297 // allocate "str" buffer with the return value + 1, then call it again to get the path.
298 enum NPPM_GETPLUGINSCONFIGDIR = .NPPMSG + 46;
299 
300 //core.sys.windows.windef.BOOL NPPM_MSGTOPLUGIN(core.sys.windows.winnt.WCHAR* destModuleName, CommunicationInfo* info)
301 // return value is core.sys.windows.windef.TRUE when the message arrive to the destination plugins.
302 // if destModule or info is core.sys.windows.windef.NULL, then return value is core.sys.windows.windef.FALSE
303 enum NPPM_MSGTOPLUGIN = .NPPMSG + 47;
304 struct CommunicationInfo
305 {
306 	static import core.sys.windows.winnt;
307 
308 	core.stdc.config.c_long internalMsg;
309 	const (core.sys.windows.winnt.WCHAR)* srcModuleName;
310 
311 	/**
312 	 * defined by plugin
313 	 */
314 	void* info;
315 }
316 
317 //void NPPM_MENUCOMMAND(0, int cmdID)
318 // uncomment //private static import npp_api.powereditor.menucmdid;
319 // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
320 // to access all the Notepad++ menu command items
321 enum NPPM_MENUCOMMAND = .NPPMSG + 48;
322 
323 //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)
324 enum NPPM_TRIGGERTABBARCONTEXTMENU = .NPPMSG + 49;
325 
326 // int NPPM_GETNPPVERSION(0, 0)
327 // return version
328 // ex : v4.6
329 // core.sys.windows.windef.HIWORD(version) == 4
330 // core.sys.windows.windef.LOWORD(version) == 6
331 enum NPPM_GETNPPVERSION = .NPPMSG + 50;
332 
333 // core.sys.windows.windef.BOOL NPPM_HIDETABBAR(0, core.sys.windows.windef.BOOL hideOrNot)
334 // if hideOrNot is set as core.sys.windows.windef.TRUE then tab bar will be hidden
335 // otherwise it'll be shown.
336 // return value : the old status value
337 enum NPPM_HIDETABBAR = .NPPMSG + 51;
338 
339 // core.sys.windows.windef.BOOL NPPM_ISTABBARHIDDEN(0, 0)
340 // returned value : core.sys.windows.windef.TRUE if tab bar is hidden, otherwise core.sys.windows.windef.FALSE
341 enum NPPM_ISTABBARHIDDEN = .NPPMSG + 52;
342 
343 // core.sys.windows.windef.INT NPPM_GETPOSFROMBUFFERID(core.sys.windows.basetsd.UINT_PTR bufferID, core.sys.windows.windef.INT priorityView)
344 // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
345 // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly
346 //
347 // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits)
348 // Here's the values for the view :
349 //  MAIN_VIEW 0
350 //  SUB_VIEW  1
351 enum NPPM_GETPOSFROMBUFFERID = .NPPMSG + 57;
352 
353 // core.sys.windows.windef.INT NPPM_GETFULLPATHFROMBUFFERID(core.sys.windows.basetsd.UINT_PTR bufferID, core.sys.windows.winnt.WCHAR* fullFilePath)
354 // Get full path file name from a bufferID.
355 // Return -1 if the bufferID non existing, otherwise the number of core.sys.windows.winnt.WCHAR copied/to copy
356 // User should call it with fullFilePath be core.sys.windows.windef.NULL to get the number of core.sys.windows.winnt.WCHAR (not including the nul character),
357 // allocate fullFilePath with the return values + 1, then call it again to get full path file name
358 enum NPPM_GETFULLPATHFROMBUFFERID = .NPPMSG + 58;
359 
360 // core.sys.windows.windef.LRESULT NPPM_GETBUFFERIDFROMPOS(core.sys.windows.windef.INT index, core.sys.windows.windef.INT iView)
361 // wParam: Position of document
362 // lParam: View to use, 0 = Main, 1 = Secondary
363 // Returns 0 if invalid
364 enum NPPM_GETBUFFERIDFROMPOS = .NPPMSG + 59;
365 
366 // core.sys.windows.windef.LRESULT NPPM_GETCURRENTBUFFERID(0, 0)
367 // Returns active Buffer
368 enum NPPM_GETCURRENTBUFFERID = .NPPMSG + 60;
369 
370 // core.sys.windows.winnt.VOID NPPM_RELOADBUFFERID(core.sys.windows.basetsd.UINT_PTR bufferID, core.sys.windows.windef.BOOL alert)
371 // Reloads Buffer
372 // wParam: Buffer to reload
373 // lParam: 0 if no alert, else alert
374 enum NPPM_RELOADBUFFERID = .NPPMSG + 61;
375 
376 // core.sys.windows.windef.INT NPPM_GETBUFFERLANGTYPE(core.sys.windows.basetsd.UINT_PTR bufferID, 0)
377 // wParam: BufferID to get LangType from
378 // lParam: 0
379 // Returns as int, see LangType. -1 on error
380 enum NPPM_GETBUFFERLANGTYPE = .NPPMSG + 64;
381 
382 // core.sys.windows.windef.BOOL NPPM_SETBUFFERLANGTYPE(core.sys.windows.basetsd.UINT_PTR bufferID, core.sys.windows.windef.INT langType)
383 // wParam: BufferID to set LangType of
384 // lParam: LangType
385 // Returns core.sys.windows.windef.TRUE on success, core.sys.windows.windef.FALSE otherwise
386 // use int, see LangType for possible values
387 // L_USER and L_EXTERNAL are not supported
388 enum NPPM_SETBUFFERLANGTYPE = .NPPMSG + 65;
389 
390 // core.sys.windows.windef.INT NPPM_GETBUFFERENCODING(core.sys.windows.basetsd.UINT_PTR bufferID, 0)
391 // wParam: BufferID to get encoding from
392 // lParam: 0
393 // returns as int, see UniMode. -1 on error
394 enum NPPM_GETBUFFERENCODING = .NPPMSG + 66;
395 
396 // core.sys.windows.windef.BOOL NPPM_SETBUFFERENCODING(core.sys.windows.basetsd.UINT_PTR bufferID, core.sys.windows.windef.INT encoding)
397 // wParam: BufferID to set encoding of
398 // lParam: encoding
399 // Returns core.sys.windows.windef.TRUE on success, core.sys.windows.windef.FALSE otherwise
400 // use int, see UniMode
401 // Can only be done on new, unedited files
402 enum NPPM_SETBUFFERENCODING = .NPPMSG + 67;
403 
404 // core.sys.windows.windef.INT NPPM_GETBUFFERFORMAT(core.sys.windows.basetsd.UINT_PTR bufferID, 0)
405 // wParam: BufferID to get EolType format from
406 // lParam: 0
407 // returns as int, see EolType format. -1 on error
408 enum NPPM_GETBUFFERFORMAT = .NPPMSG + 68;
409 
410 // core.sys.windows.windef.BOOL NPPM_SETBUFFERFORMAT(core.sys.windows.basetsd.UINT_PTR bufferID, core.sys.windows.windef.INT format)
411 // wParam: BufferID to set EolType format of
412 // lParam: format
413 // Returns core.sys.windows.windef.TRUE on success, core.sys.windows.windef.FALSE otherwise
414 // use int, see EolType format
415 enum NPPM_SETBUFFERFORMAT = .NPPMSG + 69;
416 
417 // core.sys.windows.windef.BOOL NPPM_HIDETOOLBAR(0, core.sys.windows.windef.BOOL hideOrNot)
418 // if hideOrNot is set as core.sys.windows.windef.TRUE then tool bar will be hidden
419 // otherwise it'll be shown.
420 // return value : the old status value
421 enum NPPM_HIDETOOLBAR = .NPPMSG + 70;
422 
423 // core.sys.windows.windef.BOOL NPPM_ISTOOLBARHIDDEN(0, 0)
424 // returned value : core.sys.windows.windef.TRUE if tool bar is hidden, otherwise core.sys.windows.windef.FALSE
425 enum NPPM_ISTOOLBARHIDDEN = .NPPMSG + 71;
426 
427 // core.sys.windows.windef.BOOL NPPM_HIDEMENU(0, core.sys.windows.windef.BOOL hideOrNot)
428 // if hideOrNot is set as core.sys.windows.windef.TRUE then menu will be hidden
429 // otherwise it'll be shown.
430 // return value : the old status value
431 enum NPPM_HIDEMENU = .NPPMSG + 72;
432 
433 // core.sys.windows.windef.BOOL NPPM_ISMENUHIDDEN(0, 0)
434 // returned value : core.sys.windows.windef.TRUE if menu is hidden, otherwise core.sys.windows.windef.FALSE
435 enum NPPM_ISMENUHIDDEN = .NPPMSG + 73;
436 
437 // core.sys.windows.windef.BOOL NPPM_HIDESTATUSBAR(0, core.sys.windows.windef.BOOL hideOrNot)
438 // if hideOrNot is set as core.sys.windows.windef.TRUE then STATUSBAR will be hidden
439 // otherwise it'll be shown.
440 // return value : the old status value
441 enum NPPM_HIDESTATUSBAR = .NPPMSG + 74;
442 
443 // core.sys.windows.windef.BOOL NPPM_ISSTATUSBARHIDDEN(0, 0)
444 // returned value : core.sys.windows.windef.TRUE if STATUSBAR is hidden, otherwise core.sys.windows.windef.FALSE
445 enum NPPM_ISSTATUSBARHIDDEN = .NPPMSG + 75;
446 
447 // core.sys.windows.windef.BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey* sk)
448 // get your plugin command current mapped shortcut into sk via cmdID
449 // You may need it after getting NPPN_READY notification
450 // returned value : core.sys.windows.windef.TRUE if this function call is successful and shortcut is enable, otherwise core.sys.windows.windef.FALSE
451 enum NPPM_GETSHORTCUTBYCMDID = .NPPMSG + 76;
452 
453 // core.sys.windows.windef.BOOL NPPM_DOOPEN(0, scope const core.sys.windows.winnt.WCHAR* fullPathName2Open)
454 // fullPathName2Open indicates the full file path name to be opened.
455 // The return value is core.sys.windows.windef.TRUE (1) if the operation is successful, otherwise core.sys.windows.windef.FALSE (0).
456 enum NPPM_DOOPEN = .NPPMSG + 77;
457 
458 // core.sys.windows.windef.BOOL NPPM_SAVECURRENTFILEAS (core.sys.windows.windef.BOOL asCopy, scope const core.sys.windows.winnt.WCHAR* filename)
459 enum NPPM_SAVECURRENTFILEAS = .NPPMSG + 78;
460 
461 // core.sys.windows.windef.INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0)
462 // returned value : the current native language encoding
463 enum NPPM_GETCURRENTNATIVELANGENCODING = .NPPMSG + 79;
464 
465 // returns core.sys.windows.windef.TRUE if NPPM_ALLOCATECMDID is supported
466 // Use to identify if subclassing is necessary
467 enum NPPM_ALLOCATESUPPORTED = .NPPMSG + 80;
468 
469 // core.sys.windows.windef.BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber)
470 // sets startNumber to the initial command ID if successful
471 // Returns: core.sys.windows.windef.TRUE if successful, core.sys.windows.windef.FALSE otherwise. startNumber will also be set to 0 if unsuccessful
472 enum NPPM_ALLOCATECMDID = .NPPMSG + 81;
473 
474 // core.sys.windows.windef.BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber)
475 // sets startNumber to the initial command ID if successful
476 // Allocates a marker number to a plugin
477 // Returns: core.sys.windows.windef.TRUE if successful, core.sys.windows.windef.FALSE otherwise. startNumber will also be set to 0 if unsuccessful
478 enum NPPM_ALLOCATEMARKER = .NPPMSG + 82;
479 
480 // core.sys.windows.windef.INT NPPM_GETLANGUAGENAME(int langType, core.sys.windows.winnt.WCHAR* langName)
481 // Get programming language name from the given language type (LangType)
482 // Return value is the number of copied character / number of character to copy (\0 is not included)
483 // You should call this function 2 times - the first time you pass langName as core.sys.windows.windef.NULL to get the number of characters to copy.
484 // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time
485 // by passing allocated buffer as argument langName
486 enum NPPM_GETLANGUAGENAME = .NPPMSG + 83;
487 
488 // core.sys.windows.windef.INT NPPM_GETLANGUAGEDESC(int langType, core.sys.windows.winnt.WCHAR* langDesc)
489 // Get programming language short description from the given language type (LangType)
490 // Return value is the number of copied character / number of character to copy (\0 is not included)
491 // You should call this function 2 times - the first time you pass langDesc as core.sys.windows.windef.NULL to get the number of characters to copy.
492 // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
493 // by passing allocated buffer as argument langDesc
494 enum NPPM_GETLANGUAGEDESC = .NPPMSG + 84;
495 
496 // core.sys.windows.winnt.VOID NPPM_SHOWDOCSWITCHER(0, core.sys.windows.windef.BOOL toShowOrNot)
497 // Send this message to show or hide doc switcher.
498 // if toShowOrNot is core.sys.windows.windef.TRUE then show doc switcher, otherwise hide it.
499 enum NPPM_SHOWDOCSWITCHER = .NPPMSG + 85;
500 
501 // core.sys.windows.windef.BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0)
502 // Check to see if doc switcher is shown.
503 enum NPPM_ISDOCSWITCHERSHOWN = .NPPMSG + 86;
504 
505 // core.sys.windows.windef.BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
506 // Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.
507 enum NPPM_GETAPPDATAPLUGINSALLOWED = .NPPMSG + 87;
508 
509 // core.sys.windows.windef.INT NPPM_GETCURRENTVIEW(0, 0)
510 // Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary
511 enum NPPM_GETCURRENTVIEW = .NPPMSG + 88;
512 
513 // core.sys.windows.winnt.VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, core.sys.windows.windef.BOOL disableOrNot)
514 // Disable or enable extension column of doc switcher
515 enum NPPM_DOCSWITCHERDISABLECOLUMN = .NPPMSG + 89;
516 
517 // core.sys.windows.windef.INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0)
518 // Return: current editor default foreground color. You should convert the returned value in core.sys.windows.windef.COLORREF
519 enum NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR = .NPPMSG + 90;
520 
521 // core.sys.windows.windef.INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0)
522 // Return: current editor default background color. You should convert the returned value in core.sys.windows.windef.COLORREF
523 enum NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR = .NPPMSG + 91;
524 
525 // core.sys.windows.winnt.VOID NPPM_SETSMOOTHFONT(0, core.sys.windows.windef.BOOL setSmoothFontOrNot)
526 enum NPPM_SETSMOOTHFONT = .NPPMSG + 92;
527 
528 // core.sys.windows.winnt.VOID NPPM_SETEDITORBORDEREDGE(0, core.sys.windows.windef.BOOL withEditorBorderEdgeOrNot)
529 enum NPPM_SETEDITORBORDEREDGE = .NPPMSG + 93;
530 
531 // core.sys.windows.winnt.VOID NPPM_SAVEFILE(0, scope const core.sys.windows.winnt.WCHAR* fileNameToSave)
532 enum NPPM_SAVEFILE = .NPPMSG + 94;
533 
534 // 2119 in decimal
535 // core.sys.windows.winnt.VOID NPPM_DISABLEAUTOUPDATE(0, 0)
536 enum NPPM_DISABLEAUTOUPDATE = .NPPMSG + 95;
537 
538 // 2120 in decimal
539 enum NPPM_REMOVESHORTCUTBYCMDID = .NPPMSG + 96;
540 
541 // core.sys.windows.windef.BOOL NPPM_REMOVESHORTCUTASSIGNMENT(int cmdID)
542 // removes the assigned shortcut mapped to cmdID
543 // returned value : TRUE if function call is successful, otherwise FALSE
544 
545 // core.sys.windows.windef.INT NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR *pluginRootPath)
546 // Get plugin home root path. It's useful if plugins want to get its own path
547 // by appending <pluginFolderName> which is the name of plugin without extension part.
548 // Returns the number of TCHAR copied/to copy.
549 // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character),
550 // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path.
551 enum NPPM_GETPLUGINHOMEPATH = .NPPMSG + 97;
552 
553 // core.sys.windows.windef.BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, core.sys.windows.winnt.WCHAR* str)
554 // where str is the allocated core.sys.windows.winnt.WCHAR array,
555 // strLen is the allocated array size
556 // The return value is core.sys.windows.windef.TRUE when get generic_string operation success
557 // Otherwise (allocated array size is too core.sys.windows.rpcndr.small) core.sys.windows.windef.FALSE
558 enum RUNCOMMAND_USER = core.sys.windows.winuser.WM_USER + 3000;
559 enum NPPM_GETFULLCURRENTPATH = .RUNCOMMAND_USER + .FULL_CURRENT_PATH;
560 enum NPPM_GETCURRENTDIRECTORY = .RUNCOMMAND_USER + .CURRENT_DIRECTORY;
561 enum NPPM_GETFILENAME = .RUNCOMMAND_USER + .FILE_NAME;
562 enum NPPM_GETNAMEPART = .RUNCOMMAND_USER + .NAME_PART;
563 enum NPPM_GETEXTPART = .RUNCOMMAND_USER + .EXT_PART;
564 enum NPPM_GETCURRENTWORD = .RUNCOMMAND_USER + .CURRENT_WORD;
565 enum NPPM_GETNPPDIRECTORY = .RUNCOMMAND_USER + .NPP_DIRECTORY;
566 enum NPPM_GETFILENAMEATCURSOR = .RUNCOMMAND_USER + .GETFILENAMEATCURSOR;
567 
568 // core.sys.windows.windef.INT NPPM_GETCURRENTLINE(0, 0)
569 // return the caret current position line
570 enum NPPM_GETCURRENTLINE = .RUNCOMMAND_USER + .CURRENT_LINE;
571 
572 // core.sys.windows.windef.INT NPPM_GETCURRENTCOLUMN(0, 0)
573 // return the caret current position column
574 enum NPPM_GETCURRENTCOLUMN = .RUNCOMMAND_USER + .CURRENT_COLUMN;
575 
576 enum NPPM_GETNPPFULLFILEPATH = .RUNCOMMAND_USER + .NPP_FULL_FILE_PATH;
577 
578 enum VAR_NOT_RECOGNIZED = 0;
579 enum FULL_CURRENT_PATH = 1;
580 enum CURRENT_DIRECTORY = 2;
581 enum FILE_NAME = 3;
582 enum NAME_PART = 4;
583 enum EXT_PART = 5;
584 enum CURRENT_WORD = 6;
585 enum NPP_DIRECTORY = 7;
586 enum CURRENT_LINE = 8;
587 enum CURRENT_COLUMN = 9;
588 enum NPP_FULL_FILE_PATH = 10;
589 enum GETFILENAMEATCURSOR = 11;
590 
591 // Notification code
592 enum NPPN_FIRST = 1000;
593 
594 // To notify plugins that all the procedures of launchment of notepad++ are done.
595 //(*scnNotification).nmhdr.code = .NPPN_READY;
596 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
597 //(*scnNotification).nmhdr.idFrom = 0;
598 enum NPPN_READY = .NPPN_FIRST + 1;
599 
600 // To notify plugins that toolbar icons can be registered
601 //(*scnNotification).nmhdr.code = NPPN_TB_MODIFICATION;
602 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
603 //(*scnNotification).nmhdr.idFrom = 0;
604 enum NPPN_TBMODIFICATION = .NPPN_FIRST + 2;
605 
606 // To notify plugins that the current file is about to be closed
607 //(*scnNotification).nmhdr.code = .NPPN_FILEBEFORECLOSE;
608 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
609 //(*scnNotification).nmhdr.idFrom = BufferID;
610 enum NPPN_FILEBEFORECLOSE = .NPPN_FIRST + 3;
611 
612 // To notify plugins that the current file is just opened
613 //(*scnNotification).nmhdr.code = .NPPN_FILEOPENED;
614 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
615 //(*scnNotification).nmhdr.idFrom = BufferID;
616 enum NPPN_FILEOPENED = .NPPN_FIRST + 4;
617 
618 // To notify plugins that the current file is just closed
619 //(*scnNotification).nmhdr.code = .NPPN_FILECLOSED;
620 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
621 //(*scnNotification).nmhdr.idFrom = BufferID;
622 enum NPPN_FILECLOSED = .NPPN_FIRST + 5;
623 
624 // To notify plugins that the current file is about to be opened
625 //(*scnNotification).nmhdr.code = .NPPN_FILEBEFOREOPEN;
626 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
627 //(*scnNotification).nmhdr.idFrom = BufferID;
628 enum NPPN_FILEBEFOREOPEN = .NPPN_FIRST + 6;
629 
630 // To notify plugins that the current file is about to be saved
631 //(*scnNotification).nmhdr.code = .NPPN_FILEBEFOREOPEN;
632 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
633 //(*scnNotification).nmhdr.idFrom = BufferID;
634 enum NPPN_FILEBEFORESAVE = .NPPN_FIRST + 7;
635 
636 // To notify plugins that the current file is just saved
637 //(*scnNotification).nmhdr.code = .NPPN_FILESAVED;
638 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
639 //(*scnNotification).nmhdr.idFrom = BufferID;
640 enum NPPN_FILESAVED = .NPPN_FIRST + 8;
641 
642 // To notify plugins that Notepad++ is about to be shutdowned.
643 //(*scnNotification).nmhdr.code = .NPPN_SHUTDOWN;
644 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
645 //(*scnNotification).nmhdr.idFrom = 0;
646 enum NPPN_SHUTDOWN = .NPPN_FIRST + 9;
647 
648 // To notify plugins that a buffer was activated (put to foreground).
649 //(*scnNotification).nmhdr.code = .NPPN_BUFFERACTIVATED;
650 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
651 //(*scnNotification).nmhdr.idFrom = activatedBufferID;
652 enum NPPN_BUFFERACTIVATED = .NPPN_FIRST + 10;
653 
654 // To notify plugins that the language in the current doc is just changed.
655 //(*scnNotification).nmhdr.code = .NPPN_LANGCHANGED;
656 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
657 //(*scnNotification).nmhdr.idFrom = currentBufferID;
658 enum NPPN_LANGCHANGED = .NPPN_FIRST + 11;
659 
660 // To notify plugins that user initiated a WordStyleDlg change.
661 //(*scnNotification).nmhdr.code = .NPPN_WORDSTYLESUPDATED;
662 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
663 //(*scnNotification).nmhdr.idFrom = currentBufferID;
664 enum NPPN_WORDSTYLESUPDATED = .NPPN_FIRST + 12;
665 
666 // To notify plugins that plugin command shortcut is remapped.
667 //(*scnNotification).nmhdr.code = NPPN_SHORTCUTSREMAPPED;
668 //(*scnNotification).nmhdr.hwndFrom = ShortcutKeyStructurePointer;
669 //(*scnNotification).nmhdr.idFrom = cmdID;
670 //where ShortcutKeyStructurePointer is pointer of struct ShortcutKey:
671 //struct ShortcutKey {
672 //	bool _isCtrl;
673 //	bool _isAlt;
674 //	bool _isShift;
675 //	core.sys.windows.winnt.UCHAR _key;
676 //}
677 enum NPPN_SHORTCUTREMAPPED = .NPPN_FIRST + 13;
678 
679 // To notify plugins that the current file is about to be loaded
680 //(*scnNotification).nmhdr.code = .NPPN_FILEBEFOREOPEN;
681 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
682 //(*scnNotification).nmhdr.idFrom = core.sys.windows.windef.NULL;
683 enum NPPN_FILEBEFORELOAD = .NPPN_FIRST + 14;
684 
685 // To notify plugins that file open operation failed
686 //(*scnNotification).nmhdr.code = NPPN_FILEOPENFAILED;
687 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
688 //(*scnNotification).nmhdr.idFrom = BufferID;
689 enum NPPN_FILELOADFAILED = .NPPN_FIRST + 15;
690 
691 // To notify plugins that current document change the readonly status,
692 //(*scnNotification).nmhdr.code = .NPPN_READONLYCHANGED;
693 //(*scnNotification).nmhdr.hwndFrom = bufferID;
694 //(*scnNotification).nmhdr.idFrom = docStatus;
695 // where bufferID is BufferID
696 //       docStatus can be combined by DOCSTATUS_READONLY and DOCSTATUS_BUFFERDIRTY
697 enum NPPN_READONLYCHANGED = .NPPN_FIRST + 16;
698 
699 enum DOCSTATUS_READONLY = 1;
700 enum DOCSTATUS_BUFFERDIRTY = 2;
701 
702 // To notify plugins that document order is changed
703 //(*scnNotification).nmhdr.code = .NPPN_DOCORDERCHANGED;
704 //(*scnNotification).nmhdr.hwndFrom = newIndex;
705 //(*scnNotification).nmhdr.idFrom = BufferID;
706 enum NPPN_DOCORDERCHANGED = .NPPN_FIRST + 17;
707 
708 // To notify plugins that a snapshot dirty file is loaded on startup
709 //(*scnNotification).nmhdr.code = NPPN_SNAPSHOTDIRTYFILELOADED;
710 //(*scnNotification).nmhdr.hwndFrom = core.sys.windows.windef.NULL;
711 //(*scnNotification).nmhdr.idFrom = BufferID;
712 enum NPPN_SNAPSHOTDIRTYFILELOADED = .NPPN_FIRST + 18;
713 
714 // To notify plugins that Npp shutdown has been triggered, files have not been closed yet
715 //(*scnNotification).nmhdr.code = NPPN_BEFORESHUTDOWN;
716 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
717 //(*scnNotification).nmhdr.idFrom = 0;
718 enum NPPN_BEFORESHUTDOWN = .NPPN_FIRST + 19;
719 
720 // To notify plugins that Npp shutdown has been cancelled
721 //(*scnNotification).nmhdr.code = NPPN_CANCELSHUTDOWN;
722 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
723 //(*scnNotification).nmhdr.idFrom = 0;
724 enum NPPN_CANCELSHUTDOWN = .NPPN_FIRST + 20;
725 
726 // To notify plugins that file is to be renamed
727 //(*scnNotification).nmhdr.code = NPPN_FILEBEFORERENAME;
728 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
729 //(*scnNotification).nmhdr.idFrom = BufferID;
730 enum NPPN_FILEBEFORERENAME = .NPPN_FIRST + 21;
731 
732 // To notify plugins that file rename has been cancelled
733 //(*scnNotification).nmhdr.code = NPPN_FILERENAMECANCEL;
734 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
735 //(*scnNotification).nmhdr.idFrom = BufferID;
736 enum NPPN_FILERENAMECANCEL = .NPPN_FIRST + 22;
737 
738 // To notify plugins that file has been renamed
739 //(*scnNotification).nmhdr.code = NPPN_FILERENAMED;
740 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
741 //(*scnNotification).nmhdr.idFrom = BufferID;
742 enum NPPN_FILERENAMED = .NPPN_FIRST + 23;
743 
744 // To notify plugins that file is to be deleted
745 //(*scnNotification).nmhdr.code = NPPN_FILEBEFOREDELETE;
746 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
747 //(*scnNotification).nmhdr.idFrom = BufferID;
748 enum NPPN_FILEBEFOREDELETE = .NPPN_FIRST + 24;
749 
750 // To notify plugins that file deletion has failed
751 //(*scnNotification).nmhdr.code = NPPN_FILEDELETEFAILED;
752 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
753 //(*scnNotification).nmhdr.idFrom = BufferID;
754 enum NPPN_FILEDELETEFAILED = .NPPN_FIRST + 25;
755 
756 // To notify plugins that file has been deleted
757 //(*scnNotification).nmhdr.code = NPPN_FILEDELETED;
758 //(*scnNotification).nmhdr.hwndFrom = hwndNpp;
759 //(*scnNotification).nmhdr.idFrom = BufferID;
760 enum NPPN_FILEDELETED = .NPPN_FIRST + 26;