keys?

Hi Iceplug,

Authorized users can login with a admin code. A new button appears that can shut down the system.

Unauthorized users (lets say guests) must not be able to shut the program down.

Any Ideas?

Thnx.
 
Firstly, you can not prevent your app from being closed purely in your code. You can disable the close option on the window menu (and the close button in the control box along with it) but the user will always be able to kill your program using the task manager.

The only way to prevent this is to use Window user security to deny the users access to the task manager.
 
Indeed, taskmanager can be disabled by a registryhack. However e.cancel=true on the closing event prevents closing the app. I have disabled the keyboard with a selfmade Keyboard Hook. This can disable all keys, except CTRL+ALT+DELETE. This I do through the registry.

Works fine.

:D
 
You can prevent an app from being closed but not from being terminated. There is a difference.
 
Hi,

My problem is similar, but...

I have a windows service which runs a program. I want the windows service to be able to close this (Process.CloseMainWindow()) but not the user to.

So basically, can I have e.cancel = false so that the service can close it, but so that the user cant Alt+F4 it?

Mike
 
Back
Top