IonicWind Software

IWBasic => General Questions => Topic started by: Robert34 on July 19, 2009, 06:50:51 AM

Title: Simulating mouse or keyboard inputs
Post by: Robert34 on July 19, 2009, 06:50:51 AM
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
Title: Re: Simulating mouse or keyboard inputs
Post by: ZeroDog on July 19, 2009, 10:48:07 AM
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...