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