The advice from the C/C++ Forum was to try this one, so here we go:
This topic seems to have cropped up regularly over a decade or more. I have ploughed through the exchanges in all the forums, yet I still cannot make it work. The following is a tiny Code::Blocks program, written to isolate the
problem:
// main.cpp
... minimal code down to case ID_DISABLE within case WM_COMMAND, and then ...
HMENU hmenu = GetMenu(hwnd);
EnableMenuItem(hmenu, ID_MESSAGE, MF_GRAYED );
case ID_ENABLE is similar to case ID_DISABLE above, and neither works. case ID_MESSAGE and case ID_EXIT both works as expected.
I have tinkered with EnableMenuItem(), as various posts have suggested, but without success. Can anybody help?