Click to See Complete Forum and Search --> : SystemParametersInfo doesn't work =(


Vitaly Belman
December 17th, 2001, 10:04 AM
...Or maybe I am not using it right?

bool Bool = 0;
SystemParametersInfo(114, 0, &Bool, SPIF_SENDCHANGE);




The first paremeter (114) is SPI_GETSCREENSAVERRUNNING. The whole thing supposed to change Bool to true when the screen saver is active but it doesn't seem to work.

Oh and I couldn't write the SPI_GETSCREENSAVERRUNNING as it is because it said that it isn't declared even though I #included WinUser.h. Might be the reason?


#if(WINVER >= 0x0500)
#define SPI_GETMOUSESPEED 112
#define SPI_SETMOUSESPEED 113
#define SPI_GETSCREENSAVERRUNNING 114
#endif /* WINVER >= 0x0500 */




---
Regards,
Vitaly Belman
ICQ: 1912453

NMTop40
December 17th, 2001, 10:24 AM
might be a problem with sizeof(bool) and sizeof(BOOL) being different.

I think bool is 1 byte and BOOL is 4 bytes.

Andreas Masur
December 17th, 2001, 12:55 PM
BOOL Bool = 0;

SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &Bool, SPIF_SENDCHANGE);



In order to use 'SPI_GETSCREENSAVERRUNNING' you need to define 'WINVER' before you can use the flag since it's not available in all Windows systems...

#ifndef WINVER
#define WINVER 0x0500
#endif




Ciao, Andreas

"Software is like sex, it's better when it's free." - Linus Torvalds