Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Default Menu Item

Default Menu Item

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sschilachi
    wrote on last edited by
    #1

    I have the following code to set one of the menu items as a default one (it should go bold), however the menu item is not displayed bold for some reason: MENUITEMINFO menuItemInfo; menuItemInfo.cbSize = sizeof(MENUITEMINFO); menuItemInfo.fMask = MIIM_STATE; VERIFY(pSubMenu->GetMenuItemInfo(IDC_SHOWWINDOW,&menuItemInfo)); menuItemInfo.fMask = MIIM_STATE; menuItemInfo.fType = MFS_ENABLED|MFS_DEFAULT; VERIFY(pSubMenu->SetMenuItemInfo(IDC_SHOWWINDOW,&menuItemInfo)); Both GetMenuItemInfo() and SetMenuItemInfo() are successful as they return 1, but I cannot figure out why it doesn't display the menu item as bold. Any help would be greatly appreciated Thanks

    B 1 Reply Last reply
    0
    • S sschilachi

      I have the following code to set one of the menu items as a default one (it should go bold), however the menu item is not displayed bold for some reason: MENUITEMINFO menuItemInfo; menuItemInfo.cbSize = sizeof(MENUITEMINFO); menuItemInfo.fMask = MIIM_STATE; VERIFY(pSubMenu->GetMenuItemInfo(IDC_SHOWWINDOW,&menuItemInfo)); menuItemInfo.fMask = MIIM_STATE; menuItemInfo.fType = MFS_ENABLED|MFS_DEFAULT; VERIFY(pSubMenu->SetMenuItemInfo(IDC_SHOWWINDOW,&menuItemInfo)); Both GetMenuItemInfo() and SetMenuItemInfo() are successful as they return 1, but I cannot figure out why it doesn't display the menu item as bold. Any help would be greatly appreciated Thanks

      B Offline
      B Offline
      Branislav
      wrote on last edited by
      #2

      Try to change menuItemInfo.fType = MFS_ENABLED|MFS_DEFAULT; // Type has MFT_ with fState = MFS_ENABLED|MFS_DEFAULT;

      S 1 Reply Last reply
      0
      • B Branislav

        Try to change menuItemInfo.fType = MFS_ENABLED|MFS_DEFAULT; // Type has MFT_ with fState = MFS_ENABLED|MFS_DEFAULT;

        S Offline
        S Offline
        sschilachi
        wrote on last edited by
        #3

        I have tried that but for some reason it does not seem to work, that is why I asked the question in the 1st place. Thanks

        B 1 Reply Last reply
        0
        • S sschilachi

          I have tried that but for some reason it does not seem to work, that is why I asked the question in the 1st place. Thanks

          B Offline
          B Offline
          Branislav
          wrote on last edited by
          #4

          I suggest you that you can use another function like this in API: SetMenuDefaultItem(hMenu,IDM_,FALSE);

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups