10-10-2018 03:13 PM
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.
10-10-2018 03:20 PM
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?
10-10-2018 03:21 PM
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...
10-10-2018 03:25 PM - edited 10-10-2018 03:28 PM
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.
10-10-2018 03:26 PM
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.
10-10-2018 03:47 PM
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?
10-10-2018 04:19 PM
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).
10-10-2018 04:28 PM
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.
10-10-2018 04:50 PM
Placing those two nodes directly into my sub VI does not accomplish what I am hoping either.
10-10-2018 04:53 PM
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?