How to prevent the user from closing an application before he logs off?

How to prevent the user from closing an application before he logs off?

Post by Jan Nordgr » Tue, 08 Jun 2004 22:54:29


I have a Visual Basic program running in the
background that I can not allow the user to unload before he logs off.

Before I put code in the queryunload method the user could keep a Notepad
document open and log off. The operating system would close my background
program and invite the user to Cancel the logging off process when it
reached the Notepad document.

In my queryunload method now I give the user 60 seconds to save his work
before I force a log off using Randy Birch's code at
http://www.yqcomputer.com/

Unfortunately, when one tries to end the program from task manager (or by
logging off) after ten seconds the operating system
gets impatient and says the program is not responding inviting the user to
Cancel or End the program.

Is there a way to increase this limit of 10 seconds? Or, does a better
approach exist?

Regards,
Jan Nordgreen

---

My diary:
http://www.yqcomputer.com/

Seductive math problems for the modern mind:
http://www.yqcomputer.com/

Tools for better schools:
http://www.yqcomputer.com/

What I read:
http://www.yqcomputer.com/

Mathematical ulterior motives:
http://www.yqcomputer.com/