LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Popup menus

Hi, does anybody know of a way of producing popup menus in LabVIEW. I want
to create my own click menu over a picture say. Is there any activeX
control or windows dll to do this? Cheers, Tom.
0 Kudos
Message 1 of 4
(2,773 Views)
Hi, Tom (or Karen?)

All Windows popup functionallity you need is found in the user32.dll in the winnt\system32 folder. Use the Call Library Function in LabVIEW to call it. The descriptions of the functions is found in the MSDN online:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows_api_reference.asp

You are intressed in the "Menu" category and I would guess you need the following functions:

CreatePopupMenu - Creates the menu
AppendMenu - Adds item to the menu
TrackPopupMenu - Popups the menu and waits for a menu item to be selected
DestroyMenu - Destroys the menu
EnableMenuItem - Controls if an item is enabled or disabled

You might also need some functions to get the Window of the VI fronpanel (else
you do not know where to popup the menu). These functions are found in the "Window" category.

FindWindow - finds the Window pointer of a VI frontpanel
ClientToScreen - some coordiate transformations

The flags definitions and their numeric values are found in the "windows.h" file (search on the web).

Hope this help. Unfortunatly I do not have any LabVIEW code examples, but this is the way to to it (in Windows anyway).

Best regards,

Mattias Ericsson
Endevo
Gothenburg, Sweden
www.endevo.se
0 Kudos
Message 2 of 4
(2,773 Views)
I attached example of my VIs for creating Popup menus.

Question about using these VIs send to

n_chernin@hotmail.com
Message 3 of 4
(2,773 Views)
Thanks Mattias,
Yes these functions seem to do everything i need. Quite a job to produce a
labview wrapper for them, will have a go some time. I will post the result
on this thread. Thanks again,
Tom.


> You are intressed in the "Menu" category and I would guess you need
> the following functions:
>
> CreatePopupMenu - Creates the menu
> AppendMenu - Adds item to the menu
> TrackPopupMenu - Popups the menu and waits for a menu item to be
> selected
> DestroyMenu - Destroys the menu
> EnableMenuItem - Controls if an item is enabled or disabled
>
> You might also need some functions to get the Window of the VI
> fronpanel (else you do not know where to popup the menu). These
> functions are found in the "Window" category.
>
> FindWindow - finds the Window p
ointer of a VI frontpanel
> ClientToScreen - some coordiate transformations
>
> The flags definitions and their numeric values are found in the
> "windows.h" file (search on the web).
>
> Hope this help. Unfortunatly I do not have any LabVIEW code examples,
> but this is the way to to it (in Windows anyway).
>
> Best regards,
>
> Mattias Ericsson
> Endevo
> Gothenburg, Sweden
> www.endevo.se
0 Kudos
Message 4 of 4
(2,773 Views)