, \t\t , How to get the exe file name when given a window handle., uses ..., enumStuff;, 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;, ----------, Two notes:, (1) My unit "enumStuff" is free, even for commercial usage., (2) This solution works in all current (win95, win95osr2, win98, wIn98se, winme, win NT4, 2000) en kan ook in de toekomst xp besturingssysteem van Microsoft (bijna).,,,
Previous:De verbinding komt?
Next Page:Het gebruik van tobjectlist,