I'm using Qt on Mac and Windows. Is there a good way with QProcess or something similar to find the parent process of my application? I need to find out what application launched my application.
Asked
Active
Viewed 1,064 times
1
-
AFAIK there isn't any such API. – Frank Osterfeld Jan 11 '13 at 14:37
-
QProcess cannot do this. Could you elaborate a little on what you are planning to do with this information. Maybe there is another simple way to do it. – Sebastian Negraszus Jan 11 '13 at 14:53
-
I just need to know what process started my application and change the way my application reacts accordingly. – Adam Haile Jan 11 '13 at 14:55
-
You'll possibly need to write two solutions as the Windows process tree, and Mac process tree are different. http://stackoverflow.com/questions/185254/how-can-a-win32-process-get-the-pid-of-its-parent shows how to extract the PID of the parent for win32. – Nicholas Smith Jan 11 '13 at 14:57
-
I guess the parent applications are not your own, so interprocess communication or passing arguments is not possible, right? – Sebastian Negraszus Jan 11 '13 at 15:00
-
@SebastianNegraszus - You are correct. – Adam Haile Jan 11 '13 at 16:27