423,688 Members | 2,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,688 IT Pros & Developers. It's quick & easy.

parking windows - WM_QUERYENDSESSION

P: n/a
Hi
When I use the WM_QUERYENDSESSION event to prevent closing of my app when
Windows is shut down, I get the 'windows forms parking window' appearing
which is very confusing for users.
Any ideas how to stop this?

Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
quilkin,

What do you mean the windows forms parking window?
--
- Nicholas Paldino [.NET/C# MVP]
- ca*******@caspershouse.com

"quilkin" <qu*****@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Hi
When I use the WM_QUERYENDSESSION event to prevent closing of my app when
Windows is shut down, I get the 'windows forms parking window' appearing
which is very confusing for users.
Any ideas how to stop this?

Nov 17 '05 #2

P: n/a
Nicholas,

There is such a hidden window created by the Framework - you can find it
with Spy++ (or a similar tool). Looks like it becomes visible under some
circumstances. The author should probably post more details on how s/he
handles the WM_QUERYENDSESSION message.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uS**************@tk2msftngp13.phx.gbl...
quilkin,

What do you mean the windows forms parking window?
--
- Nicholas Paldino [.NET/C# MVP]
- ca*******@caspershouse.com

"quilkin" <qu*****@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Hi
When I use the WM_QUERYENDSESSION event to prevent closing of my app when
Windows is shut down, I get the 'windows forms parking window' appearing
which is very confusing for users.
Any ideas how to stop this?



Nov 17 '05 #3

P: n/a
Dmytro

Since posting my original message I haven't seen the 'parking window' again!
However for compeltenes my handling of the message is below.
Perhaps I should call the Base method in the case of WM_ENDSESSION

protected override void WndProc(ref Message m)
{
if(m.Msg==0x0011) //WM_QUERYENDSESSION
{
mainForm.shutDown = true;
Trace.WriteLine("Shutting Down - TrayIcon WndProc");
mainForm.Show();
MessageBox.Show("You must close System5 Logger before shutting down");
}
else if(m.Msg==0x0016) //WM_ENDSESSION
{
mainForm.shutDown = true;
Trace.WriteLine("Shutting Down 2 - TrayIcon WndProc");
}
else
base.WndProc(ref m);
}
"Dmytro Lapshyn [MVP]" wrote:
Nicholas,

There is such a hidden window created by the Framework - you can find it
with Spy++ (or a similar tool). Looks like it becomes visible under some
circumstances. The author should probably post more details on how s/he
handles the WM_QUERYENDSESSION message.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uS**************@tk2msftngp13.phx.gbl...
quilkin,

What do you mean the windows forms parking window?
--
- Nicholas Paldino [.NET/C# MVP]
- ca*******@caspershouse.com

"quilkin" <qu*****@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Hi
When I use the WM_QUERYENDSESSION event to prevent closing of my app when
Windows is shut down, I get the 'windows forms parking window' appearing
which is very confusing for users.
Any ideas how to stop this?



Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.