Process launching
-
Dear all I want to launch a process from another process. I have tested "WinExec", "CreateProcess", "ShellExecute" and "ShellExecuteEx" APIs. In all of them, the lanuched process becomes child of the caller process. But I need that lauched proccess does not have a parent or has another parent e.g. "explorer" process. Indeed I have a Windows Service which I want to launch a GUI application from it. In addition I don't want to set Service as an Interactive Service. Any help would be appreciated
-
Dear all I want to launch a process from another process. I have tested "WinExec", "CreateProcess", "ShellExecute" and "ShellExecuteEx" APIs. In all of them, the lanuched process becomes child of the caller process. But I need that lauched proccess does not have a parent or has another parent e.g. "explorer" process. Indeed I have a Windows Service which I want to launch a GUI application from it. In addition I don't want to set Service as an Interactive Service. Any help would be appreciated
Masud Alipour wrote: But I need that lauched proccess does not have a parent It looks like the
CREATE_NEW_PROCESS_GROUP
flag toCreateProcess``()
will do that. --Mike-- LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD -
Masud Alipour wrote: But I need that lauched proccess does not have a parent It looks like the
CREATE_NEW_PROCESS_GROUP
flag toCreateProcess``()
will do that. --Mike-- LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DDDear Mike, I am trying to do the same, but using
CREATE_NEW_PROCESS_GROUP
will not make the launched process be a direct descendent of "explorer.exe". Is it because the calling process that callsCreateProcess()
is not a parent? What I mean is, imaganing the following process tree from top to bottom. explore.exe-->A.exe->B.exe The calling process is "B.exe", which calls CreateProcess()with CREATE_NEW_PROCESS_GROUP to create "C.exe". And I found "C.exe" becomes a child process of A.exe, instead of "explorer.exe" Is it normal? Is it possible to move "C.exe" the be at least the level as "A.exe"? Thanks in advance, Johnny