@@ -78,7 +78,7 @@ static internal void CommandMenuInit()
78
78
79
79
// get path of plugin configuration
80
80
StringBuilder sbIniFilePath = new StringBuilder ( Win32 . MAX_PATH ) ;
81
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_GETPLUGINSCONFIGDIR , Win32 . MAX_PATH , sbIniFilePath ) ;
81
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_GETPLUGINSCONFIGDIR , Win32 . MAX_PATH , sbIniFilePath ) ;
82
82
iniFilePath = sbIniFilePath . ToString ( ) ;
83
83
84
84
// if config path doesn't exist, we create it
@@ -134,7 +134,7 @@ static internal void SetToolBarIcon()
134
134
tbIcons . hToolbarBmp = tbBmp . GetHbitmap ( ) ;
135
135
IntPtr pTbIcons = Marshal . AllocHGlobal ( Marshal . SizeOf ( tbIcons ) ) ;
136
136
Marshal . StructureToPtr ( tbIcons , pTbIcons , false ) ;
137
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_ADDTOOLBARICON , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , pTbIcons ) ;
137
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_ADDTOOLBARICON , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , pTbIcons ) ;
138
138
Marshal . FreeHGlobal ( pTbIcons ) ;
139
139
}
140
140
@@ -234,7 +234,7 @@ static void insertCurrentPath(NppMsg which)
234
234
msg = NppMsg . NPPM_GETCURRENTDIRECTORY ;
235
235
236
236
StringBuilder path = new StringBuilder ( Win32 . MAX_PATH ) ;
237
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , msg , 0 , path ) ;
237
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) msg , 0 , path ) ;
238
238
239
239
editor . ReplaceSel ( path . ToString ( ) ) ;
240
240
}
@@ -266,7 +266,7 @@ static void checkInsertHtmlCloseTag()
266
266
static internal void doInsertHtmlCloseTag ( char newChar )
267
267
{
268
268
LangType docType = LangType . L_TEXT ;
269
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_GETCURRENTLANGTYPE , 0 , ref docType ) ;
269
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_GETCURRENTLANGTYPE , 0 , ref docType ) ;
270
270
bool isDocTypeHTML = ( docType == LangType . L_HTML || docType == LangType . L_XML || docType == LangType . L_PHP ) ;
271
271
272
272
if ( ! doCloseTag || ! isDocTypeHTML )
@@ -323,18 +323,18 @@ static internal void doInsertHtmlCloseTag(char newChar)
323
323
324
324
static void getFileNamesDemo ( )
325
325
{
326
- int nbFile = ( int ) Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_GETNBOPENFILES , 0 , 0 ) ;
326
+ int nbFile = ( int ) Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_GETNBOPENFILES , 0 , 0 ) ;
327
327
MessageBox . Show ( nbFile . ToString ( ) , "Number of opened files:" ) ;
328
328
329
329
using ( ClikeStringArray cStrArray = new ClikeStringArray ( nbFile , Win32 . MAX_PATH ) )
330
330
{
331
- if ( Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_GETOPENFILENAMES , cStrArray . NativePointer , nbFile ) != IntPtr . Zero )
331
+ if ( Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_GETOPENFILENAMES , cStrArray . NativePointer , nbFile ) != IntPtr . Zero )
332
332
foreach ( string file in cStrArray . ManagedStringsUnicode ) MessageBox . Show ( file ) ;
333
333
}
334
334
}
335
335
static void getSessionFileNamesDemo ( )
336
336
{
337
- int nbFile = ( int ) Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_GETNBSESSIONFILES , 0 , sessionFilePath ) ;
337
+ int nbFile = ( int ) Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_GETNBSESSIONFILES , 0 , sessionFilePath ) ;
338
338
339
339
if ( nbFile < 1 )
340
340
{
@@ -345,13 +345,13 @@ static void getSessionFileNamesDemo()
345
345
346
346
using ( ClikeStringArray cStrArray = new ClikeStringArray ( nbFile , Win32 . MAX_PATH ) )
347
347
{
348
- if ( Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_GETSESSIONFILES , cStrArray . NativePointer , sessionFilePath ) != IntPtr . Zero )
348
+ if ( Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_GETSESSIONFILES , cStrArray . NativePointer , sessionFilePath ) != IntPtr . Zero )
349
349
foreach ( string file in cStrArray . ManagedStringsUnicode ) MessageBox . Show ( file ) ;
350
350
}
351
351
}
352
352
static void saveCurrentSessionDemo ( )
353
353
{
354
- string sessionPath = Marshal . PtrToStringUni ( Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_SAVECURRENTSESSION , 0 , sessionFilePath ) ) ;
354
+ string sessionPath = Marshal . PtrToStringUni ( Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_SAVECURRENTSESSION , 0 , sessionFilePath ) ) ;
355
355
if ( ! string . IsNullOrEmpty ( sessionPath ) )
356
356
MessageBox . Show ( sessionPath , "Saved Session File :" , MessageBoxButtons . OK ) ;
357
357
}
@@ -392,21 +392,21 @@ static void DockableDlgDemo()
392
392
IntPtr _ptrNppTbData = Marshal . AllocHGlobal ( Marshal . SizeOf ( _nppTbData ) ) ;
393
393
Marshal . StructureToPtr ( _nppTbData , _ptrNppTbData , false ) ;
394
394
395
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_DMMREGASDCKDLG , 0 , _ptrNppTbData ) ;
395
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_DMMREGASDCKDLG , 0 , _ptrNppTbData ) ;
396
396
// Following message will toogle both menu item state and toolbar button
397
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_SETMENUITEMCHECK , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , 1 ) ;
397
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_SETMENUITEMCHECK , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , 1 ) ;
398
398
}
399
399
else
400
400
{
401
401
if ( ! frmGoToLine . Visible )
402
402
{
403
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_DMMSHOW , 0 , frmGoToLine . Handle ) ;
404
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_SETMENUITEMCHECK , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , 1 ) ;
403
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_DMMSHOW , 0 , frmGoToLine . Handle ) ;
404
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_SETMENUITEMCHECK , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , 1 ) ;
405
405
}
406
406
else
407
407
{
408
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_DMMHIDE , 0 , frmGoToLine . Handle ) ;
409
- Win32 . SendMessage ( PluginBase . nppData . _nppHandle , NppMsg . NPPM_SETMENUITEMCHECK , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , 0 ) ;
408
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_DMMHIDE , 0 , frmGoToLine . Handle ) ;
409
+ Win32 . SendMessage ( PluginBase . nppData . _nppHandle , ( uint ) NppMsg . NPPM_SETMENUITEMCHECK , PluginBase . _funcItems . Items [ idFrmGotToLine ] . _cmdID , 0 ) ;
410
410
}
411
411
}
412
412
frmGoToLine . textBox1 . Focus ( ) ;
0 commit comments