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==0x001 1) //WM_QUERYENDSESS ION
{
mainForm.shutDo wn = true;
Trace.WriteLine ("Shutting Down - TrayIcon WndProc");
mainForm.Show() ;
MessageBox.Show ("You must close System5 Logger before shutting down");
}
else if(m.Msg==0x001 6) //WM_ENDSESSION
{
mainForm.shutDo wn = true;
Trace.WriteLine ("Shutting Down 2 - TrayIcon WndProc");
}
else
base.WndProc(re f 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_QUERYENDSESS ION message.
--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uS******** ******@tk2msftn gp13.phx.gbl... quilkin,
What do you mean the windows forms parking window?
--
- Nicholas Paldino [.NET/C# MVP]
- ca*******@caspe rshouse.com
"quilkin" <qu*****@discus sions.microsoft .com> wrote in message
news:1B******** *************** ***********@mic rosoft.com... Hi
When I use the WM_QUERYENDSESS ION 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?