Hi Peter,
Thank you for posting in the community!
Based on my understanding, you use CreateProcessWithLogonW to create a new
process through P/invoke. You want to be notified when that new process
exits.
======================================
Because the new created process has almost no relationship with your
process, there is not an easy way to access the information of the new
created process.
Interprocess access in Win32 need much support of the operating system.
And in .Net, there is no way to get what you want, because .Net does not
expose function for interprocess operation. If you can I suggest you use
.Net Process class to replace CreateProcessWithLogonW API.
For Process class, it expose an Exited event, which you can be notified
when you created process exited.
If you still can not use Process class, the only workaround I can think of
is kept enumerating all the processes in the system to query if the new
created process exited.
This is not a good solution, and it has a poor performance.
For How to enumerate process in Win32, please refer to:
http://support.microsoft.com/default...b;en-us;175030
=====================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.