Текущий архив: 2007.01.21;
Скачать: CL | DM;
Вниз
Как имея ID процесса узнать имя файла и путь этого процесса? Найти похожие ветки
← →
hero © (2006-12-29 08:57) [0]Как имея ID процесса узнать имя файла и путь этого процесса?
← →
Elen © (2006-12-29 09:02) [1]
> hero
Вот не помню откуда выдрано :function ProcessFileName(PID: DWORD): string;
var
Handle: THandle;
begin
Result := "";
Handle := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, PID);
if Handle <> 0 then
try
SetLength(Result, MAX_PATH);
if FullPath then
begin
if GetModuleFileNameEx(Handle, 0, PChar(Result), MAX_PATH) > 0 then
SetLength(Result, StrLen(PChar(Result)))
else
Result := "";
end
else
begin
if GetModuleBaseNameA(Handle, 0, PChar(Result), MAX_PATH) > 0 then
SetLength(Result, StrLen(PChar(Result)))
else
Result := "";
end;
finally
CloseHandle(Handle);
end;
end;
Нуженuses PsAPI
Страницы: 1 вся ветка
Текущий архив: 2007.01.21;
Скачать: CL | DM;
Память: 0.44 MB
Время: 0.031 c