(Gast)
n/a Beiträge
|
Re: hProcess aus dwProcessId bekommen?
3. Feb 2009, 05:52
Delphi-Quellcode:
hWnd, dwPid,
hProcess: Cardinal;
begin
hWnd := FindWindow('Notepad', 0);
if hWnd <> 0 then
begin
GetWindowThreadProcessID( hWnd, dwPid );
if dwPid <> 0 then
begin
hProcess := OpenProcess( PROCESS_ALL_ACCESS, False, dwPid );
if hProcess <> 0 then
begin
// code
end else
// Errorbehandlung
end else
// Errorbehandlung
end else
// Errorbehandlung
end;
|
|
Zitat
|