Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4652 Notepad++ context menu (rt click) enables "grayed" items

All
open
nobody
5
2014-01-18
2014-01-18
Ken Scudero
No

Notepad++ context menu (rt click) enables "grayed" menu items.
Microsoft developer notes describe "grayed" menu items as both "disabled" and "non-selectable".

Discovered this while adding "bells & whistles" to my custom language lexer plugin.
Could not find an existing bug report.
Solution attached. One-line change. Tested.

NppBigSwitch.cpp:
LRESULT Notepad_plus_Window::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
...
case WM_CONTEXTMENU :
...
- isEnable.push_back((::GetMenuState(_mainMenuHandle, tmp[i]._cmdID, MF_BYCOMMAND)&(MF_DISABLED)) == 0);
+ isEnable.push_back((::GetMenuState(_mainMenuHandle, tmp[i]._cmdID, MF_BYCOMMAND)&(MF_DISABLED|MF_GRAYED)) == 0);

1 Attachments

Discussion