LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn off monitor and block input

Solved!
Go to solution

Hi,

I am trying to create simple VI which will turn off the monitor (or turn on screensaver) and block input from mouse and keyboard - so user will not be able to see the display and make any action. I am using system32.dll to do that.

 

My problem is that when my VI turn off the monitor, user can turn it back again by simply moving mouse or using keyboard, even that these devices are blocked (by function BlockInput from System32.dll). 

 

How can i make ultimate freeze?

 

Attached VI is based on Danny_Funk "Turn off monitor.vi".

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 1 of 5
(4,448 Views)

Why do you want to do this?

 

It sounds like you want a PC to just lock up and you force someone to pull the cord to get it to reboot?

0 Kudos
Message 2 of 5
(4,415 Views)

ctrl+alt+del to restore control. I need that to force to fair competition in programming championships.

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 3 of 5
(4,399 Views)
Solution
Accepted by bienieck

Dear bieneck,

 

 

That is a very interesting problem you've got there. I've been snooping around Microsoft's support for a bit, and the only reasonably simple method I found was running powercfg.exe from an elevated comand line. You can query wake programmable devices with powercfg -devicequery wake_programmable, and the disable them using powercfg -devicedisablewake "Name of your device"Here you can find some more detailed documentation. 

Save that, I could not find any reliable method that spares you excessive digging in the registry. Maybe some 3rd-party tool

 

One additional thing: If your goal is to stop the user from interacting with anything, would not it be easier just to pop up a big modal window that does not allow bypass? To me at least, this seems a whole lot more staightforward to using a Windows native function that is not at all intended for this purpose.

 

Kind regards:

Andrew Valko
National Instruments Hungary
Message 4 of 5
(4,375 Views)

I forgot about modals Smiley Embarassed Thanks ValkoA!

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 5 of 5
(4,362 Views)