Thread: Turn off screensaver via function call

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    22

    Turn off screensaver via function call

    I would like to turn off the screensaver, if it is currently running. I have found these two functions, but neither of them seem to work.

    Code:
    SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0);
    SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_SCREENSAVE, -1);

    Any help is appreciated.

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    OS?
    Compiler?

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    Tried:-
    Code:
    HKEY hKey;
    
    RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_SET_VALUE, &hKey);
    RegSetValueEx(hKey, "ScreenSaveActive", 0, REG_SZ, "0", 1);
    RegCloseKey(hKey);
    ?

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    22
    Originally posted by golfinguy4
    OS?
    Compiler?
    WinXP
    MS Visual C++ 6

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. I need some quick help with code.
    By stehigs321 in forum C Programming
    Replies: 35
    Last Post: 10-30-2003, 10:07 PM
  5. Unknown C ESP function call error message
    By wbeasl in forum C Programming
    Replies: 1
    Last Post: 10-08-2003, 01:33 PM