Hi,
I have created a VI that uses the Win32 API functions to display a popup meu on a VI's front panel. This isn't a decorated text box filled, showed and hidden with a property node, but a real windows system popup menu.
Anybody want to test it out? I'd appreciate any feedback, fixes or better implementations.
The VI uses several sub VIs encapsulate the API calls for convenience, error checking and appearance.
CreatePopupMenu is used to get a menu handle to a new empty menu structure. AppendMenu is called with the MF_BYPOSITION and MF_STRING constants to add menu items from a string array. TrackPopupMenu is called with the menu handle, a window handle (FindWindow gets the window handle), an
d the default flags for menu tracking. DestroyMenu is called to reclaim resources used by the menu.
I have used sub VIs and the DLL from the Windows Messageing Queue llb available on the Developer Zone. I have used several other handy API calls to convert screen coordinates to client window coordinates using both POINTs and RECTs, etc.
Hope y'all find this stuff useful, and if you get it to work on an NT or 2000 machine, let me know. If it doesn't work, let me know that too. I can tote a cussin' with the best of them.
John Wilson
Sanders Engineering & Analytical Services, Inc.
Mobile, AL
251-633-4120
johnwilson@pctechnician.net