Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transparent Menus
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
01089904
Message ID:
01090328
Views:
11
Terry,

No mimicking, even VFP main menu can be transparent.

The WS_EX_LAYERED attribute cannot be used for child windows. That means only top-level windows (like FoxPro forms with ShowWindow=2) can be transparent. This restriction is imposed by the Windows OS.

Menus are top-level windows. They can be made transparent same as any other top-level window. Same SetLayeredWindowAttributes function to be called. The trick is in obtaining the window handle for a menu window to use it as a parameter in SetLayeredWindowAttributes call.

VFP9 has advanced version of BINDEVENT() that allows to intercept window messages. In particular, intercepting WM_DRAWITEM and WM_INITMENUPOPUP messages does the job. The DRAWITEMSTRUCT structure contains the device context for a menu window. The window handle is retrieved through the WindowFromDC call, voila!

That's true, transparency may make a menu less readable. Still I think it's possible to pick proper combination of parameters/colors to make it work. Of course, the windows transparency delivered by Vista is going to be far more superior :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform