Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Killing a menu but keep its functionality
Message
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00452294
Message ID:
00452309
Views:
22
>Hi All,
>I'd thought I'd get into the act of giving tips. Some may be useless in nature as I'm sure this one is.
>
>If for some reason, you want to kill the VFP menu, you can issue a SET SYSMENU TO. However, this has the unwanted (at least by me) side effect of leaving a blank area where your menu was. You could use SET SYSMENU OFF. This gets rid of the menu area.
>
>Both of these solutions leave you with no keyboard functionality unless you program it using ON KEY LABEL. The following code will kill the main VFP menu but leave all the hot keys active.
>declare integer GetActiveWindow in user32
>declare integer GetMenu in user32 integer hwnd
>declare integer SetMenu in user32 integer hwnd, integer hmenu
>declare integer DestroyMenu in user32 integer hmenu
>
>local lnh, lnm
>lnh = GetActiveWindow()
>lnm = GetMenu(lnh)
>DestroyMenu(lnm)
>SetMenu(lnh,0)
>Windows menus are hierarchical. The main menu has menu items that contain submenus. Each of these is also a menu that can contain more submenus. The above code destroys the main menu but leaves the submenus intact. Their key combinations still work.
>
>Feel free to use this tip (or not) to make your lives brighter. :-)

Maybe submit this as a FAQ or API?
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform