function WindowToExe( window : dword ) : String;
var
pid : dword;
pl : TProcessList;
i1 : integer;
begin
Result := '';
pl := nil;
GetWindowThreadProcessID( Window, @pid );
if pid <> 0 then
begin
pl := GetProcessList;
for i1 := 0 to high( pl ) do
if pl[ i1 ].pid = pid then
begin
Result := pl[ i1 ].name;
break;
end;
end;
end;
|