How can I excute code when the user end the MS application by Alt+Ctrl+Delete

accesser2003

Registered User.
Local time
Today, 11:55
Joined
Jun 2, 2007
Messages
124
Some times, the system become stuck, which forces the user to end the program using Windows Alt+Ctrl+Delete. I have MS Access code which I want to execute when the user made the 'End Program' event using the Alt+Ctrl+Delete.

Thanks,
 
What do you mean the UnHidden form?
 
I dont think this is possible with a hiden form. You could probably use one of the Win32 API's to hook into the messaging to the window and trap the close message or what ever message is sent to the window with the ctrl+Alt+delete.
 
Is there a reason the user needs to use the three finger salute? Is your application difficult to exit? Are you allowed to break their fingers, or at least bend them a little?
 
Is there a reason the user needs to use the three finger salute? Is your application difficult to exit? Are you allowed to break their fingers, or at least bend them a little?

OP said the application was hanging. I am not sure if the three finger salute will allow a new event to be run in Access.
 
D'oh! I can't believe I didn't read the 1st post in the thread. It sounds like some diagnostic code might be necessary to determine why the application is stuck.
 
D'oh! I can't believe I didn't read the 1st post in the thread. It sounds like some diagnostic code might be necessary to determine why the application is stuck.
RG

It's always easy to spot my own mistakes in other people :D
 
I have no claims on "best" ways to debug, but it seems that a useful feature would be to implement some little dumb subroutine in a general module, callable from anywhere (class module, macro using RunCode, report, or other module). Have it open a table-type recordset to a table with logging entries. Log date/time, user, object name, and where applicable, sub-object name or location. When it hangs and your user does the nasty salute, look at the logging table when it becomes available again.

At least that will tell you where in your app the situation became hung. (After that last log point and before the next one in sequence, obviously...)
 
I still didnt get the answer. Is there a specific API I can use to acheive this?
 
I still didnt get the answer. Is there a specific API I can use to acheive this?
I think the point is that you're trying to solve the wrong problem. If your application doesn't hang then the users won't need to Ctrl-Alt-Del.
 
When the system hang, I want to clear the current user from the CurrentUsers recordset, otherwise he will not be able to make another logon into the system.
 
This is yet another issue that shows you are trying to solve the wrong problem.

Find out why this happens in the first place. Then you won't HAVE to clear out your current user.

But then again, WHAT currentusers recordset? If your problem child can't log in after using the three-finger salute, that's GOOD for his sorry butt. That will teach him to shut down a perfectly good computer...

More seriously, if you are yourself tracking the current users in a formal table you have created, that is one thing. But if you think that Access is doing that, your problem is that you don't know about the LDB file. Are you, in fact, tracking something in Access using a feature you wrote yourself to lock out users from opening a second session? Or are you just jumping to confusions about why the user can't get in again?
 

Users who are viewing this thread

Back
Top Bottom