LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a control invisible in a LabVIEW executable

Hello:

 

We are in need of making a control invisible in a LabVIEW executable, generated with LabVIEW 2009.  The control is not strictly necessary, but is misbehaving and the customer wants it hidden. We do not have access to the whole source code of the application, only a few VIs have been obtained. It's a 6 year old program, and our customer has lost the contact with the original developer.  

 

First, we did some research, trying to do something using VI Server or something similar, but we couldn't get much far.  Then, we explored some alternative ideas like the one shown in the following web site:

 

http://www.codeproject.com/Articles/790966/Hosting-And-Changing-Controls-In-Other-Application

 

The basic idea is that using Windows API calls, you basically can modify the properties of controls in other programs, and this sounded perfect for our purposes. We tested it successfully with non-LabVIEW programs, as we could hide controls (i.e buttons) in other programs. But with the LabVIEW program we are trying to "hack", we just couldn't see any child controls of the main program window, and therefore we could not modify any properties,. This was very surprising. This may imply that LabVIEW does not use 'native' controls and instead draws everything that is shown in the front panel. Is this the case?

 

Anyone has another idea on how could we hide this conttrol? 

 

Thank you in advance for your help.



Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 1 of 7
(4,249 Views)

Yes, I think unless you're using 'System Controls' in your application (which I think might use the 'native' controls), LabVIEW handles it's own controls separately. Unless you can get VI Server to work (it would need to be enabled in at least the executable .ini file, it might need to have been built with it enabled on a specific TCP/IP port?) to be able to get a reference to the control and set the 'Visible' property to false.

 

Unfortunately, if you don't have the source code for the program, I can't think of much else you can do. Place a sticker over the screen that says "DO NOT TOUCH!" 😉


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 7
(4,242 Views)

@Sam_Sharp wrote:

Yes, I think unless you're using 'System Controls' in your application (which I think might use the 'native' controls), LabVIEW handles it's own controls separately. Unless you can get VI Server to work (it would need to be enabled in at least the executable .ini file, it might need to have been built with it enabled on a specific TCP/IP port?) to be able to get a reference to the control and set the 'Visible' property to false.

 

Unfortunately, if you don't have the source code for the program, I can't think of much else you can do. Place a sticker over the screen that says "DO NOT TOUCH!" 😉


All controls in LabVIEW are rendered completely by LabVIEW. For the system controls LabVIEW uses Windows API functions to retrieve the current metrics to draw controls that look mostly according to the currently selected Windows theme. There are no Windows window handles for LabVIEW controls that you can send messages to.

 

Enabling the VI server in the INI file should be possible. But getting access to the control without possibility to look at the source code and see exactly how everything is named/works will be at least a big hassle and more likely even impossible. VI server does on purpose not expose the entire LabVIEW object hierarchy to a remote client. Only specific methods and properties are allowed to be called from outside of the application itself.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 7
(4,224 Views)

Does the Executable always appear at a fixed location on the screenj?  If so, you could (in principle) create a "patch" that you display "on top of" the control you want to hide.  I think you can do this with LabVIEW (for example, make a Picture Control and get the rest of the VI to not show itself -- I think this is possible, but not 100% certain ...).

 

Obviously, the Best Way (and most sure way) is to have the Source and modify it.  Depending on how important this is, ahd now complex, might it be time to start working on Version 2 (where you keep control of the Source)?  LabVIEW 2015 has a number of advantages over LabVIEW 2009 ... (and, had it been LabVIEW 7, there would be no question ...)

 

BS

0 Kudos
Message 4 of 7
(4,204 Views)

If you are good at Windows API, you can create a static window with the same size of the control, same color as the front panel, and make it a child window of the LabVIEW panel, block the the control.

Make the static no titlebar, no frame to blend into the panel.

 

 

 

George Zou
Message 5 of 7
(4,197 Views)

Here's an old tool I dug up.  It lets you mess with controls on FPs of VIs inside a .exe.

The main VI is: App_Probe.zip\DevTools\Code\App_Probe_LV9.vi

You'll probably have to do a fair amount of pruning & rework on this.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 7
(4,138 Views)

As others have said, LabVIEW generally draws everything itself.  I heard being cross platform has some influence on that decision.  You can't always rely on the OS draw functions to be the same.  There were some discussions over on LAVA recently about setting the color of the menu bar in LabVIEW using Windows calls, and there too you learn that LabVIEW isn't using the built in OS draw functions for creating a menu, but instead make their own that looks and behaves like the OS one.

 

Without the source, VI Server is your only decent option, and it isn't all that good.  The code posted earlier will help.  It will edit your INI file, launch it, then attempt to get the VIs in the EXE, and with that you can try to manipulate controls and other properties.  There is some issues with this, like all the deprecated functions that might not work so well in modern LabVIEW versions.  Oh and then there is the fact that I believe you will need the same version of LabVIEW that the EXE was built with in your development environment, since the code is in the EXE without the source it can't recompile for other versions of LabVIEW.  2009 should be too hard to get a hold of.

 

I'd push back and either get a hold of the source, live with it, or re-write it.  Then again I'm sure you've explored these options already.

0 Kudos
Message 7 of 7
(4,110 Views)