Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted
So, how is the application shut down by authorized users?

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

Hi Iceplug,

 

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

 

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

 

Any Ideas?

 

Thnx.

Intellectuals solve problems, geniuses prevent them!
  • Leaders
Posted

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.

Those who live by the sword get shot by those who don't!
Posted

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

Intellectuals solve problems, geniuses prevent them!
  • Leaders
Posted
You can prevent an app from being closed but not from being terminated. There is a difference.
Those who live by the sword get shot by those who don't!
  • 2 weeks later...
Posted

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 can't Alt+F4 it?

 

Mike

:) Mike :)

 

He who has a secret, must keep it secret he has a secret to keep......

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...