0

link app with windows process so that when user terminated or end the process it says used by another process and also need to insert it into system file like shutdown file using c sharp so that my app never end or terminates i tried that material but not usefull

this.ShowInTaskbar = false;

I also tried that code in click:

WindowsImpersonationContext ctx = null;
if (!WindowsIdentity.GetCurrent().IsSystem)
{
   ctx = WindowsIdentity.Impersonate(System.IntPtr.Zero);
}
string thisuser = WindowsIdentity.GetCurrent().Name;   

But have a look at image it is still present in process, what I want is that my process never stops.

image

north start
  • 71
  • 1
  • 9
  • i tried every solution on net like 'http://stackoverflow.com/questions/15716567/launch-process-and-hide-command-line-parameters-from-task-manager.' – north start Jun 01 '16 at 08:59
  • and many other solutions from stack over flow so it mean it is not Duplicate questiobn – north start Jun 01 '16 at 09:00

1 Answers1

0

what I want is that my process never stops.

To ensure that your process is always running and is started when Windows boots it's easiest to create a windows service instead. It will probably still show up somewhere in task manager and could be killed manually by the user. But windows will try to keep it running.

How to create a service: https://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx

And if you need other programs to communicate with your service I find it easy to use a WCF service instead. https://msdn.microsoft.com/en-us/library/bb386386.aspx

m4ttsson
  • 203
  • 2
  • 8
  • can you tell me how to link your app with windows builtin service so that when process terminated from window manager it return used by another process – north start Jun 01 '16 at 12:13
  • i think this is the only best solution we have there and also i have modified the question kindly view that again\ – north start Jun 01 '16 at 12:14
  • Even if it returns as "used by another process" a user could still terminate the second process and then your process. Maybe a windows service accessible only to administrators that checks so your application is always running? Se also http://stackoverflow.com/questions/17476063/unstoppable-application-in-windows – m4ttsson Jun 01 '16 at 14:16