CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2000
    Posts
    199

    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

  2. #2
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    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.



  3. #3
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    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
  •  





Click Here to Expand Forum to Full Width

Featured