I'm testing the windows API's menu states (disabled, grayed, checked...) but there's something I don't understand. The documentation states that MF_DISABLED
does not gray an item but here's what I get:
with this code:
HMENU menuBar = CreateMenu();
HMENU hopMenu = CreateMenu();
AppendMenuW(menuBar, MF_POPUP, (UINT_PTR)hopMenu, L"hop");
AppendMenuW(hopMenu, MF_STRING, 0, L"Enabled");
AppendMenuW(hopMenu, MF_STRING | MF_DISABLED, 1, L"Disabled");
AppendMenuW(hopMenu, MF_STRING | MF_GRAYED, 2, L"Grayed");
AppendMenuW(hopMenu, MF_STRING | MF_CHECKED, 3, L"Checked");
AppendMenuW(hopMenu, MF_STRING | MF_DISABLED | MF_CHECKED, 4, L"Disabled && Checked");
AppendMenuW(hopMenu, MF_STRING | MF_DISABLED | MF_GRAYED, 5, L"Disabled && Grayed");
AppendMenuW(hopMenu, MF_STRING | MF_CHECKED | MF_GRAYED, 6, L"Checked && Grayed");
SetMenu(hwnd, menuBar);
How can I have a disabled menu item not grayed, then?
These two are now the same. See tagMENUITEMINFOA for more info.
Both MFS_DISABLED
and MFS_GRAYED
are grayed now as they represent the same value of 0x00000003L
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With