LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining / Restoring Window Z-Order

LV 2013, Win7

 

My app has 15-20 windows, a couple of them resizable, all openable at one time.

 

For convenience, I remember each window's screen position and size in a PREFs file when shutting down and restore it when re-launching, so that the windows remain where you left them.

 

What I'm NOT doing, is restoring the Z-order.  I always bring up the windows in order A, B, C... so that if you shut down with window A overlapping window B, then it comes up with window B overlapping window A.

 

How can I record the Z-order, and restore it?

Is there a way to find the frontmost?  Maybe I could close it first, and then find the frontmost and close it, then find the frontmost again...

 

Any ideas?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 4
(3,082 Views)
0 Kudos
Message 2 of 4
(3,052 Views)

Hello ,

 

you can read out all VIs in memory and then use the property FP.isFrontmost to find the one in the front.

How Can I Bring the Front Panel in Front of All Desktop Windows?

Programmatically Move Any Window to the Front

I think you can record the sequence, how the VI´s are closed into a ini file to reload them in the sequence you want to open the frontpanels. During closing a frontpanel or changing something manually in it, the frontpanel come to the front and this will make the challenge, to know where it was before and should it be saved with this position or with the new one.

 

best regards
Alexander
0 Kudos
Message 3 of 4
(3,051 Views)

Here's a set of Windows DLL calls for window manipulation including Z order.

 

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

 

And a thread on LAVA about making windows frontmost.

 

https://lavag.org/topic/12751-how-do-you-make-your-application-window-frontmost/#entry113072

Message 4 of 4
(3,006 Views)