I want to disable the menu item in the plugin.
For the Total Commander menu, any option works:
HWND hTCHandle = FindWindowEx(0, 0, L"TTOTAL_CMD", 0);
1. EnableMenuItem(GetSubMenu(GetMenu(hTCHandle), 0), 0, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
2. EnableMenuItem(GetSubMenu(GetMenu(hTCHandle), 0), 502, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
3. EnableMenuItem(GetMenu(hTCHandle), 502, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
Naturally, the most correct option is 3.
For the Lister menu, command numbers are unknown. Therefore, I try to disable it using option 1:
HWND hLstHandle = FindWindowEx(0, 0, L"TLister", 0);
1. EnableMenuItem(GetSubMenu(GetMenu(hLstHandle), 0), 0, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
MF_DISABLED works. MF_GRAYED does not work. The menu item does not become gray.
How to solve this problem? And does the Lister menu have command numbers? To do option 3.
Disable Lister menu item
Moderators: Hacker, petermad, Stefan2, white