Link to home
Start Free TrialLog in
Avatar of kpurchase
kpurchase

asked on

Disable Task Bar Right Click Close

I need VBA code for a MS Access 2003 database to disable the ability to right click and close the database. We have code in place that disables the [x] close button (upper right hand corner) for the application but need the code to disable the ability to right click and close the database/application on the task bar. I need this to work for the following OS's: XP, Win7 and Server 2008. But at least XP and Win7. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kpurchase
kpurchase

ASKER

This does not close the application in Win7 (sweet!)... However when right clicking and selection close on the taskbar it removes it from the taskbar.. Any thoughts on how to not make it leave the taskbar and/or re-add it to the taskbar?
If I am understanding your request, ...If this is possible, (and I don't know that it is) I don't think it will work in all versions of Windows you are specifying...

<Any thoughts on how to not make it leave the taskbar and/or re-add it to the taskbar?>
This is now a new requirement...
...While you can start an application from the task manager, it is anyone guess how you would automate this.

What I am saying is that at whenever level you may be able to do this, it won't be what you would call "Easy".
(a couple of lines of code in VBA).

There is but so much you can do from stopping a user form doing what ever they want...

Finally it is rare for a user to use the task manager (Ctrl-Alt-Del) to simply "Close" a program.
The common reason this happens is if the app locks up.
So perhaps you should go back and evaluate the interface of your app and make sure that it is designed so restrictively as to NOT let a user exit normally, if they have to.

In other words, it is very rare that a application would need something this extreme. (task manager control over a specific application)

JeffCoachman
<<This does not close the application in Win7 (sweet!)... However when right clicking and selection close on the taskbar it removes it from the taskbar.. Any thoughts on how to not make it leave the taskbar and/or re-add it to the taskbar? >>

 I don't have Win 7 to test, but that should not allow a close.  I didn't think a right click on the task bar was any different then a close of the main window.

 Of course killing it through task manager is a different thing entirely and Win 7 may be doing something different.

 Are you sure it's actually shutting down with the right click from the task bar and not just removing it?

Jim.
Hi Jim,
Sorry you are right it appears it works appropriately I think I had multiple projects open at once (one of which did not have the changes). I just now have to figure out my flagging issues. Thanks!
Thanks!