30 #include <nsWindowsRegKey.h>
32 #define SCREENSAVER_ENABLED "1"
33 #define SCREENSAVER_DISABLED "0"
49 NS_NAMED_LITERAL_STRING(regKeyPath,
"Control Panel\\Desktop");
50 NS_NAMED_LITERAL_STRING(regKeyValueName,
"ScreenSaveActive");
52 nsresult rv = NS_ERROR_UNEXPECTED;
53 nsCOMPtr<nsIWindowsRegKey> regKey =
54 do_CreateInstance(NS_WINDOWSREGKEY_CONTRACTID, &rv);
55 NS_ENSURE_SUCCESS(rv, rv);
57 rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
59 nsIWindowsRegKey::ACCESS_QUERY_VALUE);
60 NS_ENSURE_SUCCESS(rv, rv);
62 nsString currentUserValue;
63 rv = regKey->ReadStringValue(regKeyValueName, currentUserValue);
64 NS_ENSURE_SUCCESS(rv, rv);
67 NS_ENSURE_SUCCESS(rv, rv);
72 BOOL success = SystemParametersInfoW(SPI_SETSCREENSAVEACTIVE,
76 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
93 BOOL success = SystemParametersInfoW(SPI_SETSCREENSAVEACTIVE,
97 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
#define SCREENSAVER_ENABLED
PRPackedBool mHasUserSetting
NS_IMPL_ISUPPORTS_INHERITED0(sbScreenSaverSuppressor, sbBaseScreenSaverSuppressor) nsresult sbScreenSaverSuppressor
virtual NS_DECL_ISUPPORTS_INHERITED nsresult OnSuppress(PRBool aSuppress)
virtual ~sbScreenSaverSuppressor()
PRPackedBool mUserSetting