01-24-2017 06:37 AM
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?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-24-2017 07:24 AM
I never needed this feature, but I have found some older discussions with some ideas:
https://lavag.org/topic/10395-how-to-bring-fp-window-not-on-top/
https://forums.ni.com/t5/LabVIEW/Possible-to-move-window-to-front-without-making-active/td-p/1987859
01-24-2017 07:26 AM - edited 01-24-2017 07:53 AM
Hello CoastalMaineBi…,
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.
01-24-2017 10:30 AM
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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord