Click here to Skip to main content
15,917,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: save and load dynamic struct, need help ... Pin
Bill Wilson13-Aug-02 13:20
Bill Wilson13-Aug-02 13:20 
GeneralCListCtrl arrow key navigation Pin
dennisV13-Aug-02 7:59
dennisV13-Aug-02 7:59 
GeneralRe: CListCtrl arrow key navigation Pin
Shog913-Aug-02 8:53
sitebuilderShog913-Aug-02 8:53 
GeneralRe: CListCtrl arrow key navigation Pin
dennisV13-Aug-02 9:04
dennisV13-Aug-02 9:04 
GeneralRe: CListCtrl arrow key navigation Pin
Shog913-Aug-02 9:10
sitebuilderShog913-Aug-02 9:10 
GeneralRe: CListCtrl arrow key navigation Pin
dennisV13-Aug-02 9:32
dennisV13-Aug-02 9:32 
GeneralRe: CListCtrl arrow key navigation Pin
Shog913-Aug-02 9:36
sitebuilderShog913-Aug-02 9:36 
GeneralKill a screensaver... Pin
Matt Eckerson13-Aug-02 7:49
Matt Eckerson13-Aug-02 7:49 
Hello all,

I have a dialog app that sits in the tray and pops up a dialog to remind the user of something every hour. It obviously does no good if a screensaver is running.Smile | :) I did some searching around and found ways of interrupting it and found some good stuff from Bob Moore's site:

void CMCAlarmDlg::KillScreenSaver()
{
	HWND hwnd;

	if (hwnd = ::FindWindow ("WindowsScreenSaverClass", NULL))
	{
		::PostMessage(hwnd, WM_CLOSE, 0, 0);
		// or tried 
                //::SendMessage(hwnd, WM_CLOSE, 0, 0);
	}
	else
	{
		if (hwnd = ::FindWindow ("Default Screen Saver", NULL))
		{
			::PostMessage(hwnd, WM_CLOSE, 0, 0);
		}
	}
}

This does work on Win2K, but not on NT 4. I've tried several other things (tried this one too: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q140723)but haven't had any success. Several people have mentioned how unreliable FindWindow() can be.

My question is, is there another way to interrupt the screensaver by a keyboard or a mouse? Bob Moore mentions doing this himself with hooks, but doesn't elaborate. Hooks are a bit beyond my beginners skill level anyway. Or has anyone had good luck with something that works across the board (9x, NT, 2K, XP)

Ideas? Big Grin | :-D

Thank you all (again) in advance.

Matt
GeneralRe: Kill a screensaver... Pin
Alexander Wiseman13-Aug-02 8:35
Alexander Wiseman13-Aug-02 8:35 
GeneralRe: Kill a screensaver... Pin
Matt Eckerson13-Aug-02 10:42
Matt Eckerson13-Aug-02 10:42 
GeneralRe: Kill a screensaver... Pin
Alexander Wiseman13-Aug-02 10:47
Alexander Wiseman13-Aug-02 10:47 
GeneralRe: Kill a screensaver... Pin
Matt Eckerson17-Aug-02 12:26
Matt Eckerson17-Aug-02 12:26 
GeneralISAPI File Writing Pin
John Pepper13-Aug-02 7:26
John Pepper13-Aug-02 7:26 
GeneralRe: ISAPI File Writing Pin
Jason Henderson13-Aug-02 9:14
Jason Henderson13-Aug-02 9:14 
GeneralRe: ISAPI File Writing Pin
John Pepper13-Aug-02 9:30
John Pepper13-Aug-02 9:30 
GeneralRe: ISAPI File Writing Pin
Jason Henderson13-Aug-02 15:59
Jason Henderson13-Aug-02 15:59 
GeneralRe: ISAPI File Writing Pin
Tomasz Sowinski13-Aug-02 9:20
Tomasz Sowinski13-Aug-02 9:20 
GeneralRe: ISAPI File Writing Pin
John Pepper13-Aug-02 9:28
John Pepper13-Aug-02 9:28 
GeneralRe: ISAPI File Writing Pin
John Pepper13-Aug-02 9:24
John Pepper13-Aug-02 9:24 
GeneralRe: ISAPI File Writing Pin
John Pepper13-Aug-02 9:35
John Pepper13-Aug-02 9:35 
GeneralRe: ISAPI File Writing Pin
John Pepper13-Aug-02 10:37
John Pepper13-Aug-02 10:37 
QuestionFTP Add-in for Visual Studio? Pin
Paul Tomsic13-Aug-02 7:01
Paul Tomsic13-Aug-02 7:01 
AnswerRe: FTP Add-in for Visual Studio? Pin
Daniel Turini13-Aug-02 7:34
Daniel Turini13-Aug-02 7:34 
GeneralRe: FTP Add-in for Visual Studio? Pin
Paul Tomsic13-Aug-02 7:58
Paul Tomsic13-Aug-02 7:58 
GeneralRe: FTP Add-in for Visual Studio? Pin
Daniel Turini13-Aug-02 8:53
Daniel Turini13-Aug-02 8:53 

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.