Click here to Skip to main content
15,881,625 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
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.

C++
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
Updated 21-Jan-13 21:37pm
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900