Loading ...
Sorry, an error occurred while loading the content.

47287Re: [LIBERTYBASIC] Disable menu item

Expand Messages
  • Lorne Russell
    Dec 17, 2013
    • 0 Attachment
      ‘execute these lines
      hMainEdit=GetSubMenu(hMainMenu,4)  ‘ refers to the fifth menu item  first item would be 0
      Call DrawMenuBar hWnd(#main)
      Sub DrawMenuBar hWnd
          CallDLL #user32, "DrawMenuBar",_
          hWnd As ulong, r As boolean
          End Sub
      Function GetSubMenu(hMenuBar,nPos)
          CallDLL #user32, "GetSubMenu",_
          hMenuBar As ulong, nPos As long,_
          GetSubMenu As ulong
          End Function
      Function GetMenu(hWnd)
          CallDLL #user32, "GetMenu",hWnd As ulong,_
          GetMenu As ulong
          End Function
      Function RemoveMenu(hMenu,hSubMenu)
          CallDLL #user32, "RemoveMenu", hMenu As ulong,_
          hSubMenu As ulong, _MF_BYCOMMAND As ulong,_
          RemoveMenu As boolean
          End Function

      Lorne Russell
      From: Sarmed
      Sent: Tuesday, December 17, 2013 7:33 AM
      Subject: [LIBERTYBASIC] Disable menu item

      Hi All,

      How could I disable menu items?
      A friend post me the following link,


      But there was a problem running the following code,

      [Menu.Init] 'Gets handle of menu bar
      CallDll #user, "GetMenu", hMain as word, hMenuBar as word 'returns handle of MENU BAR

      An error message said there is no #user Dll opened.
      What is (CallDll #user) please?
      I see (CallDll #user) in many LB news letters, how could I understand such code please?
      Thanks to your help.


    • Show all 7 messages in this topic