Click here to Skip to main content
13,596,187 members
Rate this:
Please Sign up or sign in to vote.
See more:

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 ) ;
::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
Updated 21-Jan-13 21:37pm

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 | Cookies | Terms of Service
Web04 | 2.8.180621.3 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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