How to determine running process that called/ran my program?
Posted: Thu Feb 14, 2019 12:16 am
I have software that uses a launcher .exe, then there is the actual program .exe. I will have certain parameters that do special things if they are sent to my program .exe via the launcher or with launch commands.
At any rate, some of those parameters are only for developers, so if someone were to look at my .exe and saw the launch parameters, they might be able to see what they are and then use them.
This is just ONE example of why I am asking the following.
Is there a way to determine from within a running process which other process ran it? For instance, in the example above, the program .exe would have an api call or some way to determine that it was the launcher .exe that ran it?
What commands or purebasic code is there to check to see if the current process was called/run by another process?
ProgramA runs ProgamB. ProgramB has function or api call to determine it was ProgramA that ran it?
In the example above, the parameters wouldn't even be checked if the program wasn't run by the launcher, for example.
I'd also like to keep the code ONLY within ProgramB or the program .exe, NOT the launcher .exe (i.e. ProgramA)
Any ideas or help is appreciated!
At any rate, some of those parameters are only for developers, so if someone were to look at my .exe and saw the launch parameters, they might be able to see what they are and then use them.
This is just ONE example of why I am asking the following.
Is there a way to determine from within a running process which other process ran it? For instance, in the example above, the program .exe would have an api call or some way to determine that it was the launcher .exe that ran it?
What commands or purebasic code is there to check to see if the current process was called/run by another process?
ProgramA runs ProgamB. ProgramB has function or api call to determine it was ProgramA that ran it?
In the example above, the parameters wouldn't even be checked if the program wasn't run by the launcher, for example.
I'd also like to keep the code ONLY within ProgramB or the program .exe, NOT the launcher .exe (i.e. ProgramA)
Any ideas or help is appreciated!