I need to get the PID
of an OutProc
com exe.I compare the szExeFile given by Process32First()
with my Exe name. If both the name are same, I use the th32ProcessID
given by Process32First()
.
Is there any better way of getting the PID
of outproc
com exe?
Asked
Active
Viewed 86 times
0

Pranit Kothari
- 9,721
- 10
- 61
- 137

subbu
- 3,229
- 13
- 49
- 70
-
you have not stated how much control you have of the server, if it is your own then extending it with this functionality would seem to be easiest like sharptooth says in his comment ;-) – AndersK Feb 04 '14 at 07:37
-
@SimonMourier: Nope, a process handle is not the same as process id. – sharptooth Feb 04 '14 at 09:31
-
@sharptooth - of course, but it's basically the same question with the same answer. I can be patronizing too: http://msdn.microsoft.com/en-us/library/windows/desktop/ms683215.aspx – Simon Mourier Feb 04 '14 at 11:00
-
@SimonMourier: Actually the answer is not the same. A process handle makes no sense when transferred between processes but a process id does make sense. – sharptooth Feb 04 '14 at 11:19
1 Answers
0
Yes, there is a better way - introduce a method to one of the interfaces (or craft a new interface for that) that will just obtain the current process id and return it to the caller.

sharptooth
- 167,383
- 100
- 513
- 979