trausti
asked on
Find All Runnung App ( TWindow.text )
How can i find all running application , windows name
e.g caption of the window of all running application and put it in listbox1?
e.g caption of the window of all running application and put it in listbox1?
ASKER
I get an error on
( function GetWindowList (pid: cardinal = 0; tid: cardinal = 0; onlyThoseInTaskbar: boolean = false) : TWindowList;)
TWindowList; = Error
Get you give me code for button1.click and add all the windows in listbox?
( function GetWindowList (pid: cardinal = 0; tid: cardinal = 0; onlyThoseInTaskbar: boolean = false) : TWindowList;)
TWindowList; = Error
Get you give me code for button1.click and add all the windows in listbox?
What error do you get?
And which Delphi version do you have?
And which Delphi version do you have?
ASKER
I use Delphi 4, undeclared indentifier
Something like this (not tested):
uses [...], enumStuff;
procedure TForm1.Button1Click(Sender : TObject);
var pl : TProcessList;
i1 : integer;
begin
pl := GetProcessList;
for i1 := 0 to high(pl) do
listBox1.Add(pl[i1].name);
end;
Regards, Madshi.
uses [...], enumStuff;
procedure TForm1.Button1Click(Sender
var pl : TProcessList;
i1 : integer;
begin
pl := GetProcessList;
for i1 := 0 to high(pl) do
listBox1.Add(pl[i1].name);
end;
Regards, Madshi.
ASKER
I want windowname like in macro magic
e.g Untitled - Notepad
e.g Untitled - Notepad
Something like this?
procedure TForm1.Button1Click(Sender : TObject);
var pl : TProcessList;
wl : TWindowList;
i1 : integer;
begin
pl := GetProcessList;
for i1 := 0 to high(pl) do begin
wl := GetWindowList(pl[i1].pid, 0, true);
if (wl <> nil) and (wl[0].title <> '') then
listBox1.Add(wl[0].title)
else listBox1.Add(pl[i1].name);
end;
procedure TForm1.Button1Click(Sender
var pl : TProcessList;
wl : TWindowList;
i1 : integer;
begin
pl := GetProcessList;
for i1 := 0 to high(pl) do begin
wl := GetWindowList(pl[i1].pid, 0, true);
if (wl <> nil) and (wl[0].title <> '') then
listBox1.Add(wl[0].title)
else listBox1.Add(pl[i1].name);
end;
ASKER
I get an error on TProcessList,TWindowsList
My Delphi did not understand that class
My Delphi did not understand that class
Have you installed the latest update packs (2 and 3)?
And have you added "enumStuff" to the uses clause of your unit?
You can also simply use EnumWindows and write a callback yourself (See your Win32 API documentation).
Unfortunately, I don't have the code to demonstrate currently...
(P.S: You'll find out there are a whole lot more windows than you think!! ;-)
Unfortunately, I don't have the code to demonstrate currently...
(P.S: You'll find out there are a whole lot more windows than you think!! ;-)
ASKER
I can't give you answer - mark your comments as answer -
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ASKER
See ya
http://beam.to/madshi
Regards, Madshi.