Click to See Complete Forum and Search --> : Find the name of a process


May 3rd, 1999, 09:55 AM
How can I find the name of a process%2

ilgar
May 11th, 1999, 01:09 AM
If you mean the file name then:

1. Get WindowThreadProcessId(...) to get Process ID from HWND;
2. OpenProcess(...) or GetProcessInformation(...) to get HANDLE to the process;
3. EnumProcessModules(...) to get HANDLEs to all modules of the process;
4. GetModuleFileName(...) to get path to module's file.

Actually, I had the reverse problem. And I solved it.
I think this should work.


Thanks,
Ilgar Mashayev

muscicapa
May 28th, 1999, 03:52 AM
could you tell me the reverse problem's solution
How can i find the processid from the process name

ilgar
May 28th, 1999, 10:17 AM
1. EnumProcess(...) to get process ID's array
2. OpenProcess(...) to get process handle
3. EnumModules(...) to get process' module handles
First handle is the handle to executable
4. GetModuleFileNameEx(...) to get it's path
5. Compare it with your process name

Search in the MSDN KB.(Enumerating Win32 Applications).

If you need the source mail me.

Thanks,
Ilgar Mashayev