LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i automatically maximize lab view project (if project is minimized) if no one is working on PC after one time

Solved!
Go to solution

hello

please guide me how can i automatically maximize my project (if project is minimized) after some interval if no one is working on PC.

 

Thanks in advance.

 

Thanks,

Asif

0 Kudos
Message 1 of 38
(3,000 Views)

@Asif138 wrote:

hello

please guide me how can i automatically maximize my project (if project is minimized) after some interval if no one is working on PC.

 

Thanks in advance.

 

Thanks,

Asif


Define what you mean about "project". The Front Panel of your main VI? Or something else?

0 Kudos
Message 2 of 38
(2,993 Views)

my front panel...vi

 

Thanks,

0 Kudos
Message 3 of 38
(2,989 Views)

Hi Asif,

 

use an event structure with a TimeOut event set to your "some interval".

When the TimeOut event is fired you can maximize any window you like to.

 

Btw. I would be very annoyed when user interfaces change window sizes by their own…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 38
(2,981 Views)

Thanks to replay

 

how it will check that no one is working on PC?

Thanks

0 Kudos
Message 5 of 38
(2,976 Views)

Hi Asif,

 

the TimeOut is fired when no other event is present.

"No one is working" means "no user input events"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 38
(2,969 Views)

@GerdW wrote:

Hi Asif,

 

the TimeOut is fired when no other event is present.

"No one is working" means "no user input events"…


I believe this is not this simple. If you only use that LabVIEW Event structure you can capture events belonging to this LabVIEW application. Lets imagine the LV app is minimized in the system taskbar. If a user working with any other Windows program or software, you will not get this info in the LV app. 

So we need to register somehow for a mouse movement event globally, so the LabVIEW app would capture ANY mouse event globally in the OS... Or something like that. I have to search, I have no idea how to do it.

 

Another option to try to use a .NET callback, and capture when the screen saver goes on. Then you just set the required timeout for the screensaver, capture this event from LabVIEW, and maximize front panel when needed...

0 Kudos
Message 7 of 38
(2,963 Views)

Hi,

 

there are those InputDevice functions you could use to monitor mouse/keyboard inputs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 38
(2,960 Views)
Solution
Accepted by topic author Asif138

@GerdW wrote:

Hi,

 

there are those InputDevice functions you could use to monitor mouse/keyboard inputs…


Yes, but then you need polling. Event registered would be more elegant 🙂

 

Edit: polling option, OP should modify this code as required:

 

mouse_event1.png

Message 9 of 38
(2,956 Views)

hi GerdW

thanks for replay

in block diagram in can only see that i need to edit "max window" inside case structure.

what should i put inside case structure?

 

Thanks,

0 Kudos
Message 10 of 38
(2,945 Views)