LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bring sub vi to front of all windows

Is the call to get the foreground window returning the handle to the correct window? DOes it return the handle to the window that is currently in the foreground? If so, all that code would accomplish would be to keep that window in the foreground. I think you may need to get the window handle for the VI you want to be in the foreground and pass that to the subVI.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 11 of 29
(1,561 Views)

Yes that makes sense, although I do not care if the vi that I am calling STAYS as the frontmost no matter what, as long as it is brought to the front of all windows when called.  In that case, I believe that the while loop would not be needed, correct?

0 Kudos
Message 12 of 29
(1,557 Views)

I just tried it and it looks like it does whichever window is open when i hit run, so either block diagram or front panel. But, it looks like it still only works within LabVIEW, it doesn't keep it in front of windows in other programs for me.

 

OP, it might just be that this VI doesn't do what you want, sadly...

0 Kudos
Message 13 of 29
(1,556 Views)

That makes sense, I can pass the reference into the Bring Front Panel In Foreground.vi, but I do not have any knowledge of the Call Library Function Node to pass the reference to my VI (the one that I want brought to the front of all windows) to enact that.  I see in the help for the Call Library Function Node that it should be able to accept a path, but for some reason it can not at this time. New vi is attached that adds a path that I bring in.

0 Kudos
Message 14 of 29
(1,555 Views)

bummer... if that is the case, how can I go about getting something that brings my sub vi to the front of all windows?  That post that I linked in my original post was the only thing I found that did what I was looking to do.

0 Kudos
Message 15 of 29
(1,554 Views)

I looked up where you got the VI from originally, which I guess is here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PA7NSAW

 

It says not supported for Windows 10, so that explains why it wasn't working for me. It could still work if you don't have Windows 10, do you?

0 Kudos
Message 16 of 29
(1,542 Views)

As I mentioned in my original post, that is the post that I got my VI from originally, and I am running Windows 10 on the development computer with LabView 2016 and the deployment computer is running windows 7 and does not have LabView installed (I am building the main VI and running it as an .exe on the deployment computer).

0 Kudos
Message 17 of 29
(1,534 Views)

Lol sorry, had to re-read your original post, I forgot.

 

So, yeah I think then, that you should be able to get it to work on your Windows 7.

 

Have you tried just copying the code directly onto the block diagram of your main VI? It's only two nodes, so I don't think it really needs to be in a subVI and then you don't have to deal with getting the handle to the wrong window.

0 Kudos
Message 18 of 29
(1,529 Views)

Placing those two nodes directly into my sub VI does not accomplish what I am hoping either.

0 Kudos
Message 19 of 29
(1,524 Views)

When you say subVI, do you mean the VI you are talking about is not the same as the one that is your main GUI window?

 

You say it doesn't accomplish what you are hoping for, but does anything at all happen? Or there is absolutely no change?

0 Kudos
Message 20 of 29
(1,522 Views)