Click here to Skip to main content
11,635,098 members (74,865 online)
Rate this: bad
good
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
v2

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

  Print Answers RSS
0 OriginalGriff 8,861
1 Sergey Alexandrovich Kryukov 8,459
2 Mika Wendelius 6,849
3 F-ES Sitecore 2,354
4 Suvendu Shekhar Giri 2,270


Advertise | Privacy | Mobile
Web03 | 2.8.150728.1 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2015
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