|
-
December 17th, 2001, 11:04 AM
#1
SystemParametersInfo doesn't work =(
...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
-
December 17th, 2001, 11:24 AM
#2
Re: SystemParametersInfo doesn't work =(
might be a problem with sizeof(bool) and sizeof(BOOL) being different.
I think bool is 1 byte and BOOL is 4 bytes.
-
December 17th, 2001, 01:55 PM
#3
Re: SystemParametersInfo doesn't work =(
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|