May 08, 2024, 03:00:32 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Simulating mouse or keyboard inputs

Started by Robert34, July 19, 2009, 06:50:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Robert34

I have a program that runs indefinitely without any user inputs.  There are some scheduled OS activiities that want to kick in every few minutes like the screen saver or the monitor power shutdown.  Is there a way for a program to simulate a mouse or keyboard input every once in a while to make the OS think there has been a user input and prevent these scheduled activites?

Thanks,
Robert

ZeroDog

Well, you could always have your program turn off the screensavers etc using the SystemParametersInfo API in the User32.dll.

But you can also simulate mouse movement using the MouseEventEx API in the User32.dll.  I was just looking at a sample for this somewhere on my system yesterday, but for the life of me I cant find it now...