Solved

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

Posted on 1998-09-21
7
154 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 350 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now