Click here to Skip to main content
12,348,674 members (65,406 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++
Hi,

I have a problem with windows screensaver.

My screensaver settings is On and timeout is 60 seconds.

I have created my own desktop using CreateDesktop() API of windows SDK. And switch the desktop to my own desktop.

here is the code.

DWORD dwThreadId = ::GetCurrentThreadId ( ) ;
HDESK m_hUserDesktop = 0;
HDESK m_hOrigDesktop = ::GetThreadDesktop ( dwThreadId ) ;
 
m_hUserDesktop = ::CreateDesktop ( _T("MyNewDesktop"),
0,
0,
0,
GENERIC_ALL,
0 ) ;
::SwitchDesktop ( m_hUserDesktop );
 
Sleep( 70000 );
 
::SwitchDesktop ( m_hOrigDesktop );
::CloseDesktop( m_hUserDesktop );
The problem is MyNewDesktop hides windows default screen saver in Windows7. It always displayed behind MyNewDesktop screen.
I can see the screensaver if I switch the desktop to the original one. That means screensaver appears after 60 seconds but not comes topmost.

Issue only in Windows7, It works fine in XP.

Can any one help?

Thanks in Advance, Shiju
Posted 21-Jan-13 21:29pm
shijuck421
Edited 21-Jan-13 21:37pm
Jochen Arndt132.7K
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100