Click here to Skip to main content
16,006,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAbout sending mail Pin
mkoliv29-Mar-06 3:32
mkoliv29-Mar-06 3:32 
QuestionRe: About sending mail Pin
David Crow29-Mar-06 4:43
David Crow29-Mar-06 4:43 
AnswerMessage Closed Pin
29-Mar-06 21:44
mkoliv29-Mar-06 21:44 
GeneralRe: About sending mail Pin
David Crow30-Mar-06 1:57
David Crow30-Mar-06 1:57 
QuestionTreeView Control Problem Pin
gbruyneel29-Mar-06 3:00
gbruyneel29-Mar-06 3:00 
AnswerRe: TreeView Control Problem Pin
Gavin Taylor29-Mar-06 3:27
professionalGavin Taylor29-Mar-06 3:27 
GeneralRe: TreeView Control Problem Pin
gbruyneel29-Mar-06 21:23
gbruyneel29-Mar-06 21:23 
QuestionHow to access HKEY_CURRENT_USER from local system account? Pin
khb29-Mar-06 1:54
khb29-Mar-06 1:54 
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? Pin
James R. Twine29-Mar-06 2:49
James R. Twine29-Mar-06 2:49 
GeneralRe: How to access HKEY_CURRENT_USER from local system account? Pin
khb29-Mar-06 3:08
khb29-Mar-06 3:08 
AnswerRe: How to access HKEY_CURRENT_USER from local system account? Pin
David Crow29-Mar-06 3:16
David Crow29-Mar-06 3:16 
GeneralRe: How to access HKEY_CURRENT_USER from local system account? Pin
khb29-Mar-06 3:29
khb29-Mar-06 3:29 
QuestionCan I return an array of pointers of type unsigned char[] Pin
Laughing Buddha29-Mar-06 1:52
Laughing Buddha29-Mar-06 1:52 
AnswerRe: Can I return an array of pointers of type unsigned char[] Pin
Stephen Hewitt29-Mar-06 1:55
Stephen Hewitt29-Mar-06 1:55 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
Laughing Buddha29-Mar-06 2:09
Laughing Buddha29-Mar-06 2:09 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
Stephen Hewitt29-Mar-06 2:12
Stephen Hewitt29-Mar-06 2:12 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
toxcct29-Mar-06 2:38
toxcct29-Mar-06 2:38 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
Stephen Hewitt29-Mar-06 2:40
Stephen Hewitt29-Mar-06 2:40 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
toxcct29-Mar-06 2:42
toxcct29-Mar-06 2:42 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
toxcct29-Mar-06 2:34
toxcct29-Mar-06 2:34 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
Stephen Hewitt29-Mar-06 2:43
Stephen Hewitt29-Mar-06 2:43 
AnswerRe: Can I return an array of pointers of type unsigned char[] Pin
James R. Twine29-Mar-06 2:59
James R. Twine29-Mar-06 2:59 
AnswerRe: Can I return an array of pointers of type unsigned char[] Pin
Rage29-Mar-06 2:57
professionalRage29-Mar-06 2:57 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
toxcct29-Mar-06 3:07
toxcct29-Mar-06 3:07 
GeneralRe: Can I return an array of pointers of type unsigned char[] Pin
Rage29-Mar-06 23:04
professionalRage29-Mar-06 23:04 

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

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