LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why Doesn't LabVIEW Intercept the WM_SYSCOMMAND Windows Message?

I am using the Windows Messaging vi's to try to defeat the screen saver from automatically starting (our IT people have locked us out of controlling our own screen saver). I have read that if I can dequeue the SC_SCREENSAVE message from the WM_SYSCOMMAND message I can prevent the screen saver from starting. The problem is that these vi's don't seem to be able to read WM_SYSCOMMAND messages. It works great for mouse movements but nothing more. Any help would be greatly appreciated.
0 Kudos
Message 1 of 17
(4,448 Views)
You can always go for the primitive "move the mouse" method.

___________________
Try to take over the world!
0 Kudos
Message 2 of 17
(4,436 Views)
Moving the mouse with SetCursorPos does NOT keep the screen saver from activating. Been there, tried that....doesn't work!

Anybody out there tried WM_SYSCOMMAND?
0 Kudos
Message 3 of 17
(4,430 Views)
I have used that specific VI for making the screen come on or stay on when a certain condition occurs and I believe it works fine on XP. Have you tried testing it (make the saver timeout 1 min and set this to run after 50 or 70 secs)?
If I remember correctly it worked both for the screen saver and the low power mode.

___________________
Try to take over the world!
0 Kudos
Message 4 of 17
(4,423 Views)
Thanks for the reply tst. I am not "allowed" to change the screen saver timeout (it is grayed out by our IT gestapo)!!

I just did some more testing and I am now trapping the WM_SYSCOMMAND message and even see the SC_SCREENSAVE message coming in!! What I can't seem to figure out is how to reply to the message with the appropriate value to prevent the screen saver from starting. I guess I am half way there (can trap the message), I just need some way to respond.

Thanks again.
0 Kudos
Message 5 of 17
(4,419 Views)
Windows sends out a SC_SCREENSAVE message to all running programs. If any of them set the message's Result field to -1, the screen saver won't be activated...

Message Edited by Chaos on 06-09-2005 02:07 PM

0 Kudos
Message 6 of 17
(4,414 Views)
If you cant get LabVIEW to do this by hooking the API messages from the main window let me know and I would be happy to code up a quick 5k byte EXE file for you that would do the same thing. Double click it in the morning or place it in your startup folder and no more screen saver...
0 Kudos
Message 7 of 17
(4,406 Views)
Well I had some time this afternoon and little else to do so I coded up a quick application for you to use...
It comes in at a whoping 8k so I hope you have the room to install it 😃

When you run the application it will place itself in the icon tray and just sit there. As long as its running the screen saver wont be able to start up. If you need to exit the application right click the icon for the exit menu. Enjoy!
0 Kudos
Message 8 of 17
(4,401 Views)
Thanks a bunch Chaos, I tried out the code with no luck. The screen saver started after 30 minutes with no fanfare. I am beginning to think our IS people are doing something a little extra with the policies we have pushed to us.

I think I still may be able to do this I just need a way to return that -1. Anybody know how to send WM from LabVIEW?
0 Kudos
Message 9 of 17
(4,294 Views)

Well I had some time this afternoon and little else to do so I coded up a quick application for you to use
I tried it too just out of curiosity and it also didn’t stop the screen saver.

We have no restrictions on our PCs, full admin privileges. This is on XP Pro SP2.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 10 of 17
(4,385 Views)