ant
May 29th, 2001, 02:32 PM
how would i make a program that let's you change the screensaver for windows??
--ant
--ant
|
Click to See Complete Forum and Search --> : changing ........... ant May 29th, 2001, 02:32 PM how would i make a program that let's you change the screensaver for windows?? --ant coolbiz May 29th, 2001, 03:00 PM There is an API function SystemParametersInfo() that can set the screensaver for you. -Cool Bizs ant May 29th, 2001, 03:02 PM How/where would i put that in my code? --Ant coolbiz May 29th, 2001, 03:32 PM Really sorry, gotta wrong function. SystemParametersInfo() function can only set ENABLE/DISABLE/TIMEOUT VALUE parameters. To change the screensaver itself, you'll need to modify a registry key: HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE. Set the value of the item to the new screensaver filename (fullpath). -Cool Bizs ant May 29th, 2001, 03:38 PM So what would i put in the form code? type the code so i can copy it into my project --Ant ------------------------------------------------------------------------------------------------------------------------ Want Free Software? E-mail me @: cgeorge@thevortex.com coolbiz May 29th, 2001, 05:29 PM I don't really have the code handy but I'm sure the explanation from MSDN is suficient for with the logic flow below: 1. Use RegOpenKeyEx() to open HKEY_CURRENT_USER\Control Panel\Desktop 2. Use RegSetValue() to set the SCRNSAVE.EXE value for the opened key above to the new path (ex: c:\winnt\myscrnsave.scr) 3. Use RegCloseKey() to close the opened key from 1. 4. Notify all windows that you've change the system registry by using SendMessageTimeout() function. You need to set the first parameter to HWND_BROADCAST and the second parameter to WM_SETTINGCHANGE (both are constants - need to get the value from MSDN). -Cool Bizs codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |