LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Windows Class - Auto Hot Key

I've beening using Auto Hot Key to automate vaious taks on my computer.  For example this script does two things. The first two line detects if you're in LabVIEW and converts one of the buttons on my 5-Button mouse to a CTL-B, which removes broken wires. It's pretty handy.  It works by detecting the windows class of the active window and it's LVDChild then it converts the mouse click to a CTL-B. 

 

The rest of the script is a utility to figure out the Windows Class of whatever program has focus when you press CTL-J and displays itin a messagebox. It's the easiest way to find the class of a program you want to automate with Auto Hot Key. 

 

#IfWinActive ahk_class LVDChild
XButton2::Send, ^b ; Remove Broken Wires

 

#IfWinActive
^j::
WinGetClass, class, A
MsgBox, The active window's class is "%class%".
Return

 

I noticed that when you compile a LabVIEW program into a excutable it still reports its class as LVChild. This makes it hard to have two sections of your script, one for the LabVIEW development enviroment and another one for a compiled executable. 

 

So, my question is: Is there a way to programitically set the Windows Class in LabVIEW? I can't find a appropiate place in either my top level VI's properties or in my Build Specifications. I guess, that if it's possibly a property node in my top level program or maybe a propery node in my pre-build Action VI.  Any idea where the setting is?

 

Thanks, 

 

—Ben

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

0 Kudos
Message 1 of 2
(2,685 Views)

@Ben_Manthey wrote:

So, my question is: Is there a way to programitically set the Windows Class in LabVIEW?


No. LV quite deliberately manages all that on its own and does not expose it. It's also cross platform, so some of its window handling code is probably shared across platform.

 

It might be possible to change a window class after creation using the Windows API (you'll have to look that up on the MSDN), but even if it is, I wouldn't recommend it. Like I said, LV does quite a lot of window management on its own, and I wouldn't be surprised if playing with something like this would more or less subtly break something.

 

If you want specific functionality in your executable, why not code it? I understand scripting it using AHK can be easier, but it's certainly not as robust.


___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(2,657 Views)