0

I wrote a windows form application running in my local system. I wanna make it invictible. I mean, I want to the users cannot kill the process using task manager or any other third party application. So I wrote a windows service to run this application on startup. I thought I need to run windows service as SYSTEM but how can I do that ?

Is there any spesific suggestion for this kind a situation ?

Chaagalar
  • 13
  • 6
  • 4
    Sounds a bit evil. You might have better luck getting an answer if you can convince us you'll only use this knowledge for good... – Drew Shafer Jan 19 '11 at 04:34
  • 1
    The power-up is in the lower-left corner of the screen. – Kirk Woll Jan 19 '11 at 04:39
  • @drew R u kidding ? I wrote a simple coin acceptor application for public usage not a trojan. – Chaagalar Jan 19 '11 at 04:52
  • Windows services cannot have GUIs, so it's impossible to make your Windows Forms application a service. See http://stackoverflow.com/questions/53232/how-can-i-run-a-windows-gui-application-on-as-a-service. And I do believe the "impossible" tag also applies to creating an "invincible" application. At least I hope so. The idea of a user-mode program that I can't kill is rather frightening. – Jim Mischel Jan 19 '11 at 07:10
  • @Jim If you read one more time, I told windows form aplication is runnig and the runner is windows service itself (I used process class 2 to run application). It's possible by the way, many anti virus program has a kernel and cannot kill using task manager or process explorer, such as NOD32 etc. – Chaagalar Jan 19 '11 at 08:06
  • This question, while possibly sounding very mischievous, does not require a down-vote or close as it is a valid question and there is no duplicate (I know of). –  Jan 19 '11 at 08:20
  • Do you also want them to be unable to kill the service? There's nothing hard about killing AVs like Nod32 if you have access to start/stop services on the PC. – MartW Jan 19 '11 at 08:29
  • In our company we have a taskbar, which is started by a service. With this taskbar our users can start all our company applications. Before starting a application the taskbar looks for updates and so on. If the taskbar crashed or a user stop it by the taskmanager the service starts this taskbar again. Developers and admin can not run all the time because some users have noone the have to talk with :) – edze Jan 19 '11 at 09:06

1 Answers1

2

I also had the same problem with an application at work, which the users shouldn't be able to close.

You have to allow the servie Allow service to interact with desktop. Heres an example how to do this while installing the service: http://www.codeproject.com/KB/install/cswindowsservicedesktop.aspx

Now you are able the launch a GUI application from the service, for the current logged in user. You should look in a intervall if the process for the current user is still running, if not just start it again.

See here for current user processes: http://www.codeproject.com/KB/cs/processownersid.aspx

Wowa
  • 1,791
  • 1
  • 14
  • 24
  • This might be solution but not in my case. We've still one problem here. The application is restarted in this scenario. That means the process still can be killed by users. But I don't wanna create a process can be killed by the user. I wanna create a process only killed by administrator. – Chaagalar Jan 20 '11 at 04:13
  • It doesn't matter if the GUI application is closed, if you let the service do everything. The GUI appliction only should be used to send tasks the service or receive information from the service and display it to the user. You can think of it as a client-server application. See: http://stackoverflow.com/questions/1773046/gui-and-windows-service-communication – Wowa Jan 20 '11 at 08:41
  • Do note that this stopped being supported over 10 years ago. There's no such checkbox on any modern version of Windows. And [you weren't supposed to do this even when the checkbox *was* there](http://stackoverflow.com/questions/4237225/windows-service-allow-service-to-interact-with-desktop/4237283#4237283). This was an option **for testing purposes only**, and developers abused it. Answers like this are part of the problem. – Cody Gray - on strike Jul 26 '11 at 15:15
  • 1
    i'm using windows7 and i see the checkbox quick clear :) your thoughs were all already discused. – Wowa Jul 26 '11 at 15:23