c++ - Closing process from service without killing the processes -
i searching way close process running under user windows service running under system account. i've tried not find solution except killing process.
why can't kill process? can't kill process uses tray icon. if kill process, tray icon won't disappear.
what i've tried far
i've tried use global eventhandles (did not work because child process got extremely laggy).
i tried use postmessage/sendmessage communicate process. solution did not work because windows service can not interact user interfaces,...
i found question (here on stackoverflow) describes problem: close child process windows service. question not contain nice solution.
first of don't use c++ instead of c#. next problem is, child process uses mouse hook. has run fast without many overhead. otherwise laggy mean, mouse lag on whole system.
so there no simple solution close process windows service?
a service can use setprocesswindowstation()
, setthreaddesktop()
attach interactive desktop of target process before sending messages target process.
alternatively, service can use createprocessasuser()
run new process in same session target process, , process can send messages target process.
Comments
Post a Comment