Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ok, Windows is shutting down.... how?

Posted on 1998-09-21
7
Medium Priority
?
163 Views
Last Modified: 2010-04-30
Once you press shutdown and select "Shutdown" or "Reboot" how can my application tell which was chosen?  If the system is rebooting I want to ask a quistion and if it is shutting down or logging off I want to bypass the question.

I've asked this on a few board with a "No Idea!" responce from most......   PLEASE Help!!!!
0
Comment
Question by:DaneJones
7 Comments
 
LVL 4

Expert Comment

by:idcanada
ID: 1435980
Put the following in your form unload event.

If UnloadMode =2  Then
' WinTel is Shutting Down
Msgbox "This is your Question"
Cancel = True
Else
' ???
' What ever it is
End if

0
 

Author Comment

by:DaneJones
ID: 1435981
This gets triggered when the app is getting closed by either by Shutdown, reboot, log off, or restart in Dos mode.  I want to know how to trigger it ONLY when the system is being rebooted. Not Any of the other options in the shut down menu.
0
 
LVL 2

Expert Comment

by:schild
ID: 1435982
You can't know it, becuase when you ask for it, the system send "normal" close request message, your program can never know where it asked before rebooting or restarting, in both cases it send the standard message of close request.
The same request messages are send by the tak list application as well

Schild
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:DaneJones
ID: 1435983
I FOUND IT!!!!
When the system shutsdown it saves the value from the shutdown menu in the registry at.....

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer]
"Shutdown Setting"=dword:00000001


0
 

Author Comment

by:DaneJones
ID: 1435984
Sorry Peps I'm going to with draw my question unless anyone can come up with a better solution than the one I've found...
0
 

Accepted Solution

by:
disasmbler earned 1400 total points
ID: 1435985
I'm the one that Email you....
0
 

Author Comment

by:DaneJones
ID: 1435986
Adjusted points to 355
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question