Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Catch the calls

Can anyone please tell me how to do two things the first is :- the code or a way to catch the call that stops the user from closing you app with ctrl-alt-delete, not disable ctrl-atl-delete.

The second is catch the call to stop a program closing when the log-off option is used, the user should be able to log-off but the program should not close.

Hope you can help, Peat.
0
peat042998
Asked:
peat042998
1 Solution
 
anthonycCommented:
HAHAHAHHAHAHAHHAHAH for 25 points too.. of course.
0
 
clifABBCommented:
What you need to stop the user from closing your app is in the QueryUnload event of your form:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

  If UnloadMode = vbAppWindows Or UnloadMode = vbAppTaskManager Then
    Cancel = True
  End If
End Sub

The second option isn't possible.
0
 
peat042998Author Commented:
anthonyc : it looks like you know the answer, 25 points was all I had when I posted the question.  I can up it to 100 if you can give an answer that works.  

And if you or anyone else have answers for both parts (answers that work) I will up the points to 150.

Another way which could answer part of this question is not to catch the call for the C-A-D but to take my apps entry alway from the C-A-D list.

I still need to know how to catch the call to stop a program closing when the log-off option is used, the user should be able to log-off but the program should not close.

This is very important and needed quickly the first person to give the answers that that work will get the points.

Thanks and I hope someone can help.
0
Technology Partners: 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!

 
peat042998Author Commented:
sorry clifABB that didn't work.
0
 
bernfarrCommented:
Look at the article:
  http://support.microsoft.com/support/kb/articles/q154/8/68.asp

I think this answers your question with regard to Ctrl-Alt-Delete. I believe that it will also work for programs being closed down due to logoff.
0
 
bernfarrCommented:
You might also find the article:
  http://support.microsoft.com/support/kb/articles/q114/7/76.asp

It shows how to hide a VB program from the task list.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now