473,813 Members | 3,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parking windows - WM_QUERYENDSESS ION

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?

Nov 17 '05 #1
3 8689
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?

Nov 17 '05 #2
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?



Nov 17 '05 #3
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?



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8814
by: David Meier | last post by:
I have an application running in the background, visible only by a notify icon in the system tray. I learned from other posts to catch the WM_QUERYENDSESSION and WM_ENDSESSION messages. Now, when I want to shutdown/restart the computer the application exits but the shutdown process does not continue anymore. Here's what I've done: protected override void WndProc(ref Message m) { // Exit message code. int WM_QUERYENDSESSION = 0x11;
7
7904
by: Nikki | last post by:
Hi, Can anybody help me, i want to prevent windows to close my winform of ..NET application, when user presses Alt+F4
7
6649
by: vgame64 | last post by:
hi all...i am stuck again with a simple program... I am supposed to create a parking garage rate calc that follows the rules up to 3 hours its 2 bucks, after that for its fifty cents. Max charge for a day can be 10 bucks. out of everything my taecher has said to do, one line of his instructions i do not understand: Create four objects of class parking and initialize them with customer specified parking hour durations. (Feel free to use...
4
3412
by: Markus Stoeger | last post by:
Hi, I have a problem with Application.Run() when Windows is shutting down. Please have a look at the copy&paste example program below. The application has no forms. It has only got a notify icon in the system tray and it uses Application.Run() to keep the message loop running. When the user clicks the icon, the application should shut down and exit. So far that works fine.
0
1433
by: Mike S | last post by:
Hi all, I'm trying to capture the WM_QUERYENDSESSION message in a Windows Form and prevent the session from shutting down. I overrode the Form's WndProc method to do this, but I'm completely dumbfounded, because it seems to work on every Windows computer I can find in the office and at home (Win98 and WinXP machines), _except_ my development machine. On my machine, the Form's WndProc method never even receives the WM_QUERYENDSESSION...
2
1674
by: Frank | last post by:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK to shutdown. While he's thinking about it, Windows displays a box saying the program is not responding. If the user clicks Cancel the shutdown is canceled. My program receives a WM_ENDSESSION message and tells the user that the shutdown has been canceled.
4
1890
by: Frank | last post by:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK to shutdown. While he's thinking about it, Windows displays a box saying the program is not responding, and if not answered shuts down my program. I need to delay that while until the user answers my program's dialog box. How does Windows check to see if an app is responding.
1
5326
by: Clemente | last post by:
Hi, We have a VB.Net application that is sleeping until it receives a logoff/shutdown event. We want the application running on Vista and XP. When the application receives those events it has to show a message box, so the user can answer Yes or No, and then let the logoff/ shutdown process continues.
1
4329
by: borla123 | last post by:
Hi- I'm trying to make an application that computes the fee for parking a car in a parking garage. The user should provide the Time In: and Time Out: values by using DateTimePickers. The application should calculate the cost of parking in the garage for the specified amount of time. Parking costs three dollars an hour. When calculating the total time spent in the garage, I will ignore the seconds value but the minutes value is treated as a...
0
9609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10426
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9225
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5707
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3886
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.