LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add hot key to minimize front panel in LV6.1 so it can be minimize from a program written in VB

Hi, can anyone tell me how to add a hot key to minimize front panel in LV6.1 so it can be minimize from a program written in Visual Basic? Thanks.
0 Kudos
Message 1 of 4
(2,746 Views)
I think the most elegant way would be to create a LV DLL which will be called from your program. The DLL will accept the VI path, open a reference to it (using Open VI reference from the Application Control palette) and wire that reference into a property node with the Front Panel.State property which will have a "Minimized" constant wired into it, and then close the reference.
The only problem is that I never worked with LV DLLs, so I'm not sure how you export a VI to be a DLL. Search this site, or maybe the example finder, or read the help, to learn how to do this.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,735 Views)
Also, note that when you build the EXE, the path to the VI may change. You may want to open the reference only by VI name, and not by the full path, but the VI has to be open for this to work. You should incorporate some error handling into the VI which will return error data (just a boolean) to your VB app.

___________________
Try to take over the world!
0 Kudos
Message 3 of 4
(2,727 Views)
you can use some API calls in VB. There are 2 steps involved: first, get the window handle by using findwindow() and then use the PostMessage(). A search on google will list many such pages.

you can also enable the LV application as activeX server when compiling. I never tried myself, but it should be easy to test.

-Joe
0 Kudos
Message 4 of 4
(2,721 Views)