47287Re: [LIBERTYBASIC] Disable menu item
- Dec 17, 2013‘execute these lineshMain=hwnd(#main)hMainMenu=GetMenu(hMain)hMainEdit=GetSubMenu(hMainMenu,4) ‘ refers to the fifth menu item first item would be 0result=RemoveMenu(hMainMenu,hMainEdit)Call DrawMenuBar hWnd(#main)wait'functions:Sub DrawMenuBar hWndCallDLL #user32, "DrawMenuBar",_hWnd As ulong, r As booleanEnd SubFunction GetSubMenu(hMenuBar,nPos)CallDLL #user32, "GetSubMenu",_hMenuBar As ulong, nPos As long,_GetSubMenu As ulongEnd FunctionFunction GetMenu(hWnd)CallDLL #user32, "GetMenu",hWnd As ulong,_GetMenu As ulongEnd FunctionFunction RemoveMenu(hMenu,hSubMenu)CallDLL #user32, "RemoveMenu", hMenu As ulong,_hSubMenu As ulong, _MF_BYCOMMAND As ulong,_RemoveMenu As booleanEnd Function
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.
- << Previous post in topic Next post in topic >>