Thread: Enable/Disable a whole menu?

  1. #1
    Registered User
    Join Date
    Jun 2008

    Enable/Disable a whole menu?

    I'd like to lock my whole menu while a specific function is running instead of disabling/graying specific options in each menu using SetMenuItemInfo(). Is there a way to use the menu handle (HMENU) to disable the whole thing temporarily? The problem with disabling specific menu items is the need to go back and update the function every time I add a new menu item that might affect it.

  2. #2
    train spotter
    Join Date
    Aug 2001
    near a computer
    Does SetMenu(hWnd, NULL) to disable and SetMenu(hWnd, hMenu) to enable do what you want? (as the menu will disappear while disabled)

    I can't recall if EnableWindow() works on menus.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User
    Join Date
    Jun 2008
    Huh. I guess that does the job. Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Disable/Enable LAN card by C/C++
    By vuhuythao in forum Linux Programming
    Replies: 2
    Last Post: 09-07-2010, 06:19 AM
  2. Disable and enable of lights
    By bludstayne in forum Game Programming
    Replies: 7
    Last Post: 06-03-2004, 11:30 AM
  3. Borland c++ Enable/Disable
    By icc_81 in forum C++ Programming
    Replies: 2
    Last Post: 03-26-2004, 04:10 PM
  4. enable/disable mouse cursor
    By toaster in forum C++ Programming
    Replies: 2
    Last Post: 08-22-2002, 10:47 AM
  5. Enable/Disable Toolbar *Buttons* :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 04-08-2002, 11:20 PM