parking windows - WM_QUERYENDSESSION

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
quilkin,

What do you mean the windows forms parking window?
 
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 said:
quilkin,

What do you mean the windows forms parking window?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

quilkin said:
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?
 
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 said:
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 said:
quilkin,

What do you mean the windows forms parking window?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

quilkin said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top