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