Solved

?Recognize WindowsNT-Shutdonw via API? (under NT)

Posted on 1998-08-13
4
137 Views
Last Modified: 2010-04-30
I want to recognize the windows shutdown with VB4.0. The Form_Unload does not work because
my programm has a loop in the Form_Load! So I need to recognize the windows-shutdown from somewhere else.
API?
OR: if you know how to palce my loop out of the Form_Load so that it is also startet immediately when running.

swilt wrote:" loop in the Form_Activate and look at UnloadMode in the Form_QueryUnload"
HOW??? Explain???
0
Comment
Question by:lole
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:swilt
ID: 1468741
loop in the Form_Activate and look at UnloadMode in the Form_QueryUnload
0
 

Author Comment

by:lole
ID: 1468742
Edited text of question
0
 

Author Comment

by:lole
ID: 1468743
Swilt, pleas give na example that works
0
 
LVL 14

Accepted Solution

by:
waty earned 50 total points
ID: 1468744
The only thing to do is adding a DoEvents in your loop in Form_Load

Sub Form_Load
  Do while True
     ...
     DoEvents
     ...
  Loop
End Sub

Sub Form_UnLoad
  ' *** Quit
End Sub

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

739 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