Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit f0a3980

Browse files
committed
Added windows function to enable / disable menu items
1 parent 8682490 commit f0a3980

File tree

1 file changed

+9
-3
lines changed
  • Visual Studio Project Template C#/PluginInfrastructure

1 file changed

+9
-3
lines changed

Visual Studio Project Template C#/PluginInfrastructure/Win32.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr
266266
/// If gateways are missing or incomplete, please help extend them and send your code to the project
267267
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
268268
/// </summary>
269-
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType lParam)
269+
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType lParam)
270270
{
271271
IntPtr outVal;
272272
IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
@@ -279,7 +279,7 @@ public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType
279279
[DllImport("kernel32")]
280280
public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName);
281281

282-
[DllImport("kernel32")]
282+
[DllImport("kernel32")]
283283
public static extern int GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName);
284284

285285
[DllImport("kernel32")]
@@ -288,12 +288,18 @@ public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType
288288
public const int MF_BYCOMMAND = 0;
289289
public const int MF_CHECKED = 8;
290290
public const int MF_UNCHECKED = 0;
291+
public const int MF_ENABLED = 0;
292+
public const int MF_GRAYED = 1;
293+
public const int MF_DISABLED = 2;
291294

292295
[DllImport("user32")]
293296
public static extern IntPtr GetMenu(IntPtr hWnd);
294297

295298
[DllImport("user32")]
296-
public static extern int CheckMenuItem(IntPtr hmenu, int uIDCheckItem, int uCheck);
299+
public static extern int CheckMenuItem(IntPtr hMenu, int uIDCheckItem, int uCheck);
300+
301+
[DllImport("user32")]
302+
public static extern bool EnableMenuItem(IntPtr hMenu, int uIDEnableItem, int uEnable);
297303

298304
public const int WM_CREATE = 1;
299305

0 commit comments

Comments
 (0)