Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows shuts down 1

Status
Not open for further replies.

mi1306

Technical User
Jul 14, 2004
44
BG
HI ALL,

I can not find the decision on problems will intercept when Windows shuts down.
It is necessary to use API function but what?

Thanks.
 
The form QueryUnload event easily gives you something close to that information.

Code:
Private Sub Form_QueryUnload(cancel As Integer, unloadmode As Integer)

Examine the value of unloadmode and compare against the constants listed in MSDN
The constant you want is vbAppWindows and has a value of 2. vbAppwindows is given when the current windows session is ending mwhich could mean a logoff or shutdown. Is that close enough?

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top