Solved

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

Posted on 1998-09-21
7
155 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Replace Formatted Numbers with text 9 61
Restricting text box entry from \/:?<>"| 9 77
change vba from autofit to 13.5 width? 4 28
Hide vba in gp 7 83
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

895 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

19 Experts available now in Live!

Get 1:1 Help Now