I have this
function NazwaProcesu(const uchwyt: Thandle): string;
var
pid: DWORD;
hProcess: Thandle;
sciezka: array [0..MAX_PATH - 1] of char;
begin
GetWindowThreadProcessId(uchwyt, pid);
hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, FALSE, pid);
if hProcess <> 0 then
try
GetModuleFileNameEx(hProcess, 0, sciezka, MAX_PATH)
finally
Result := sciezka;
CloseHandle(hProcess);
end;
end;
On windows 7 32 bit no problems. On Win 8 x64 i have this:
where last 3 entries should be explorer.exe, i guess. Thanks for help.