LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bring to Front - Programmitcally

Highlighted

Hello guys,

 

I'm trying to programmatically bring the front panel of my application to the front of Windows. Currently, I have a VI Server Reference hooked up to a Property Node of the VI with FP.IsFrontmost set to true. However, this only bring my application to the front when I have another LabView window open. When I'm tabbed out of LabView completely, it does not bring it to the front at all. Is there another way of achieving this? Any help would be appreciated.

 

Thanks,

Ryan

0 Kudos
Message 1 of 20
(621 Views)
Highlighted

So you want to override what Windows is doing, as far as window z-order management?  If so, you're in the wrong forum. 

I would not recommend going down this road.  As a user, if I had to operate a piece of software that forcibly placed itself on the top of all other windows, I would immediately trash/delete/uninstall/purge that software from my computer and I would immediately find another person to do my programming work.  But hey, that's just me...to each his own I guess.


aputman
LabVIEW 2017
LabVIEW Programming
Message 2 of 20
(598 Views)
Highlighted

I think this knowledge article is what you are looking for.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019N3tSAE&l=en-US

0 Kudos
Message 3 of 20
(592 Views)
Highlighted

Used to be able to this on Windows with API, but this feature was abused to pop up windows for advertisement.  So it's limited to what you have observed:

If LabVIEW (or any application) is active, it can bring any window to front;

an inactive application can not bring a window to the front.

 

 

George Zou
0 Kudos
Message 4 of 20
(549 Views)
Highlighted

@aputman wrote:

So you want to override what Windows is doing, as far as window z-order management?  If so, you're in the wrong forum. 


Seriously?  Asking how to do something in LabVIEW is in the wrong forums if they're here?  I don't think it's the OP that's confused here =/

 

There's another thread along these lines here: https://forums.ni.com/t5/LabVIEW/Bring-Window-Forward-Executable/m-p/3923832/highlight/true#M1114785  This lists recent versions of LV being tested in Win10 with success.  If you find success, you should go provide the original author with kudos.

0 Kudos
Message 5 of 20
(509 Views)
Highlighted

"Application.Bring To Front" seem to do it just fine at least most of the times.

Bring To Front.png

0 Kudos
Message 6 of 20
(475 Views)
Highlighted

@natasftw wrote:

@aputman wrote:

So you want to override what Windows is doing, as far as window z-order management?  If so, you're in the wrong forum. 


Seriously?  Asking how to do something in LabVIEW is in the wrong forums if they're here?  I don't think it's the OP that's confused here =/

 

There's another thread along these lines here: https://forums.ni.com/t5/LabVIEW/Bring-Window-Forward-Executable/m-p/3923832/highlight/true#M1114785  This lists recent versions of LV being tested in Win10 with success.  If you find success, you should go provide the original author with kudos.


The post that you link here requires LabVIEW to already be in the foreground and it requires the user to push a button inside of a LabVIEW application to bring a specific window to the foreground.  That is not what the OP requested.  The request was worded as follows:

 

When I'm tabbed out of LabView completely, it does not bring it to the front at all. Is there another way of achieving this? Any help would be appreciated.

 

I interpret that to mean that LabVIEW is modal to all other windows.

 


aputman
LabVIEW 2017
LabVIEW Programming
Message 7 of 20
(444 Views)
Highlighted

I know there are Windows APIs to bring a window to front.  They are in my toolkit 20 years ago.  What I was trying to say is that they won't work if LabVIEW is NOT the front process.  Haven't tested that myself, but that's what on Microsoft's documents.

 

LabVIEW function won't work either.  LabVIEW is just another desktop application. Bound by all Windows rules.

 

George Zou
0 Kudos
Message 8 of 20
(418 Views)
Highlighted

Thanks for the replies guys, so far I haven't been able to get any of these examples to work when LabView is minimised.

 

Windows is capable of this; a good example is when programs get sent to the quick bar in your bottom right corner. When you double click an icon, it maximises and brings that program to the front (see attached video for example). 

0 Kudos
Message 9 of 20
(407 Views)
Highlighted

Make the VI FP (or FPs) visible, and then call Application.Bring To Front. Bring to front will not automatically unminimize minimized front panels. Nor should it.

 

Attached VI will (most annoyingly) force itself upon you every 2 seconds.

 

It pops up above at least acrobat reader, notepad++ and edge, at least most of the times. Note that if you're working in an application and LV pops up, a click in the current application might immediately send it back.

0 Kudos
Message 10 of 20
(399 Views)