How do I open a process and obtain a handle too it in C++. I know that there is system()
and numerous methods to obtain a handle, but I'm sure there is a neater/alternative way to doing this. Or is system()
the only way to open a .exe from inside your own?
A common way to do this is to use the Win32 API CreateProcess
. The last parameter of this function is an out parameter to a structure ( PROCESS_INFORMATION
) containing the handle to the process ( HANDLE hProcess
).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.