Click here to Skip to main content

C / C++ / MFC

    RSS: RSS Feed

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
QuestionAbout sending mail PinmemberOliver Shikaloski4:32 29 Mar '06  
QuestionRe: About sending mail PinmemberDavidCrow5:43 29 Mar '06  
AnswerRe: About sending mail Pinmemberoliver_mak22:44 29 Mar '06  
GeneralRe: About sending mail PinmemberDavidCrow2:57 30 Mar '06  
QuestionTreeView Control Problem Pinmembergbruyneel4:00 29 Mar '06  
AnswerRe: TreeView Control Problem PinmemberGavin Taylor4:27 29 Mar '06  
GeneralRe: TreeView Control Problem Pinmembergbruyneel22:23 29 Mar '06  
QuestionHow to access HKEY_CURRENT_USER from local system account? Pinmemberkhb2:54 29 Mar '06  
Hi together,
 
I have a big problem. I hope somebody can help me:
 
I implemented a service that runs under the local system account and checks if any screen blanker is activated. I use the following code:
bool result = false;
SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, (LPVOID) &result, 0);
This works fine on Win XP, but on Win 2000 the function always return true. It is a known bug according to article number 318781 on MSDN.
 
The suggested workaround is to look for the entry "SCRNSAVE.EXE" under the registry key "HKCU\Control Panel\Desktop" using the following two lines:
RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ, &hKeyScrSave);
RegQueryValueEx(hKeyScrSave, "SCRNSAVE.EXE", NULL, NULL, (LPBYTE) szData, &dwData);
Now the problem arises: As my service runs under the local system account, access to "HKEY_CURRENT_USER" is redirected to "HKEY_USERS\.DEFAULT". Dead | X|
 
So the result refers to the logon screen saver, which is (usually) always activated. But I only want this result if no user in logged in.
 
Therefore my question: Does anybody has a solution, how to check if a screen saver is active under 2000 like SystemParametersInfo(SPI_GETSCREENSAVEACTIVE) does it for XP? An idea how to access data under "HKEY_CURRENT_USER" from the local system account would also be very valuable for me.
 
Thank you very much for any hints,
Marcus.

AnswerRe: How to access HKEY_CURRENT_USER from local system account? PinmemberJames R. Twine3:49 29 Mar '06  
GeneralRe: How to access HKEY_CURRENT_USER from local system account? Pinmemberkhb4:08 29 Mar '06  
AnswerRe: How to access HKEY_CURRENT_USER from local system account? PinmemberDavidCrow4:16 29 Mar '06  
GeneralRe: How to access HKEY_CURRENT_USER from local system account? Pinmemberkhb4:29 29 Mar '06  
QuestionCan I return an array of pointers of type unsigned char[] PinmemberLaughing Buddha2:52 29 Mar '06  
AnswerRe: Can I return an array of pointers of type unsigned char[] PinmemberStephen Hewitt2:55 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] PinmemberLaughing Buddha3:09 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] PinmemberStephen Hewitt3:12 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] Pinmemberv2.03:38 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] PinmemberStephen Hewitt3:40 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] Pinmemberv2.03:42 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] Pinmemberv2.03:34 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] PinmemberStephen Hewitt3:43 29 Mar '06  
AnswerRe: Can I return an array of pointers of type unsigned char[] PinmemberJames R. Twine3:59 29 Mar '06  
AnswerRe: Can I return an array of pointers of type unsigned char[] PinmemberRage3:57 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] Pinmemberv2.04:07 29 Mar '06  
GeneralRe: Can I return an array of pointers of type unsigned char[] PinmemberRage0:04 30 Mar '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.5.120222.1 | Last Updated 23 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid