Stopping screen saver

C

Claire

Hi,

Our software runs on a XP system attached to a touch screen monitor and
smartcard USB reader. We run our own simple corporate screen saver.
When the screen is touched the screen saver vanishes, but when a user
inserts a smartcard (we're polling for inserts) the screen saver doesn't
vanish.
Is there any way we can awaken the system and stop the screen saver from
code please?

thank you
 
J

John Duval

Hi Claire,
You could try using p/invoke to call SystemParametersInfo:

[DllImport("user32.dll", SetLastError = true)]
static extern bool SystemParametersInfo(uint uiAction, uint uiParam,
IntPtr pvParam, uint fWinIni);
public const int SPI_SETSCREENSAVEACTIVE = 0x0011;

Then call it like this:
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, IntPtr.Zero, 0);

Hope that helps,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top