|
function FindProcess( Str : String) : Boolean;
var
Process32: TProcessEntry32;
SHandle : THandle; // the handle of the Windows object
Next : BOOL;
ProcId : DWORD;
begin
result := False;
Process32.dwSize := SizeOf(TProcessEntry32);
SHandle := CreateToolHelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if Process32First(SHandle, Process32) then
begin
// 실행화일명과 process object 저장
repeat
Next := Process32Next(SHandle, Process32);
if Next then
begin
GetWindowThreadProcessID( SHandle, @ProcId );
if UpperCase(Process32.szExeFile) = Str then
begin
Result := True;
exit;
end;
end;
until not Next;
end;
CloseHandle(SHandle); // closes an open object handle
end;
이걸 어떻게 API로 바꿀수 있져??? 방법좀 알려주세여
|