LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute labview application on top of all other Labview and Windows apps

Solved!
Go to solution

Good day all,

     I'm having the next issue:

I have in production floor  PC that runs several applications: windows, LabVIEW and visual basic applications. I had to

developed an application using LabVIEW, but I require to run this app, first than the others. What I'm trying to do

is that, this application must be always on front, until operators is done using it. What I have tried up to now, is

using modal windows, programmatically been calling FRONTMOST = True. But even if I do this, operator can change

window between program, with just a click in the windows taskbar. Is there a way, to always put my desired LabVIEW application on top of every other window application that is open?

 

0 Kudos
Message 1 of 8
(3,500 Views)
Solution
Accepted by topic author JLuna

 

Use NI's Window API library to set a window to top most.

http://www.ni.com/example/29935/en/

 

A topmost window will be in the front of all normal windows even if it's not an active window.

 

 

 

George Zou
Message 2 of 8
(3,473 Views)

Ok, I've just located the subVI that is located in this library, which it's named by: "Make Windows Always on Top". It has

three inputs: window refnum (NaWR), window name and activate? (F).

 

If I'm using a state machine, should I place this subVI in the first state?

How do I retrieve the windows refnum of my main labview window??

 

 

 

 

0 Kudos
Message 3 of 8
(3,464 Views)

Take a look at this article.  It is a little bit more clear than what was linked.

0 Kudos
Message 4 of 8
(3,461 Views)

I just tested calling those two function the webpage mentions. Apparently it focuses only on other LabVIEW applications. It maintains your application with priority on top. But if for example windows explorer is open, you can place that window on top... Is there a way to even place LabVIEW application on top of every single application that is open, or might be open...

0 Kudos
Message 5 of 8
(3,453 Views)

It did the job. But it was kind of weird. Because I practically had to do a copy of the subVI and paste it, into a folder. Because

if I dragged the subVI directly from the dialog box that appears from the library file and place in the block diagram, it won't work. It has to be by copy and pasting the subVI to a folder. Then from there just drag and place it to the block diagram. At least this

way it worked for me.

 

Many thanks man! I appreciate it.

0 Kudos
Message 6 of 8
(3,442 Views)

window refnum is optional, if you don't have it, just use the window name.

You can call this VI outside the while loop.  wire the error out to the loop to enforce data flow.

Use VI property to get front panel title.

 

George Zou
0 Kudos
Message 7 of 8
(3,436 Views)

@BowenM:

SetForegroundWindow can't keep a window on top of an active window. e.g. someone can click and bring another window on top of your window.

 

George Zou
0 Kudos
Message 8 of 8
(3,435 Views)