Tricking windows

Started by
9 comments, last by atreyu 23 years, 4 months ago
I need to find a way to trick windows into thinking a user is active (ie. the mouse is being moved or something) when no one is around. I''m basically trying to keep the screensaver, sleepmode, hard disk shutdown etc. from ocurring while my program is running. I wrote a prog (with MFC/VC++) that automatically shuts down windows at a given time. The only problem is that if the computer goes into sleep mode and the program tries to shutdown the system crashes. Any ideas would help a lot. Thanks.
Advertisement
I would think an app that posted almost any Windows message, say, 4 times a minute would do the job. Create an app with no window and send a mouse move message to the top-level window every once in awhile. Or call Invalidate(), or anything that would otherwise fool Windows into thinking something onscreen happened.
Volition, Inc.
BTW - if you find something that works, please post your results here. This would be a neat trick to know.
Volition, Inc.
Ok, If I find something that works I''ll post it. Thanks for the ideas.
Ah, Windows. Who can understand why it does what it does?

Not ALL messages will work. I have programs on my sys receiving timer messages, but it''ll still sleep, etc. Screen redraws don''t seem consequential either. Or hdd access, video access, etc. It seems to be user input only. Perhaps you could do a CBT thing, which traps messages before sending them to normal programs. You could create a timer, trap it, then send a keycode to your own window. Hmm...

Good luck

David
there is a message that windows puts out as it is going into a screensaver mode, but I cannot remember what the message name was. Can some one help me out?

The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.

?Have a nice day!?

Catch WM_SYSCOMMAND and if wParam is SC_SCREENSAVE then the screensaver is trying to go on, or if it''s SC_MONITORPOWER then the monitor is trying to enter sleep mode.
If you want a program to move the mouse you can goto www.wwwhack.com and download the wwwhack program. It''ll do that and some other cool things like crack passwords to websites (of course all it does is try every possible combination, which would only take around 10 billion years to actually find a password), but the mouse movement part works fine. And you can admit the fact that you are trying to rip off whichever "get paid to surf" program you have signed up for. You don''t have to make up a lame excuse like, "basically trying to keep the screensaver, sleepmode, hard disk shutdown etc. from ocurring while my program is running." I''m sure that you, being a programmer, would know how to change a few basic settings on your computer, like for example, turning the screensaver off, turning off sleepmode, hard disk shutdown, etc. It''s not that hard, you just have to uncheck a few boxes in your display settings and power settings. So next time either don''t lie and be honest about what you''re really trying to do, or at least make up a decent excuse, because if you seriously don''t know how to turn off the screensaver, then you have no business programming any computer. Those are my thoughts anyway

Don''t take anything I said personally, I''m just messin'' with ya.

merge


http://merge.to
Hey Merge2! That''s a good guess but I wasn''t lying. I wanted to make the system shut itself off at a set time so I could go to sleep listening to mp3''s on my computer, although if you know of a "get paid to surf" company out there...
hey, what about sending a mouse move message ?

if it doesn''t work, try to send it from a mouse hook
procedure ...

This topic is closed to new replies.

Advertisement