
27.12.2009, 01:07
|
Прохожий
|
|
Регистрация: 24.12.2009
Сообщения: 8
Репутация: 10
|
|
Цитата:
Сообщение от Asinkrit
В программке что я тебе скинул, есть ответ на твой вопрос, ImageList + ListView + SHGetFileInfo, больше ничего не нужно..)
|
Всёравно не доганяю.
Код:
procedure TForm1.Button2Click(Sender: TObject);
var buff: array [0..127] of Char;
Wnd: hWnd;
i:integer;
MainWnd:THandle;
begin
ListView1.Clear;
Wnd := GetWindow(Handle, gw_HWndFirst);
while Wnd <> 0 do
begin
if (Wnd <> Application.MainForm.Handle) and
IsWindowVisible(Wnd) and
(GetWindow(Wnd, gw_Owner) = 0) and
(GetWindowText(Wnd, buff, sizeof(buff)) <> 0) and
(Wnd <> FindWindow(nil, 'Program manager'))
then
begin
GetWindowText(Wnd, buff, sizeof(buff));
ListView1.Items.Add.Caption:=StrPas(buff);
for i := 1 to ListView1.GetCount do
ListView1.Items.Item[i-1].ImageIndex:=i-1;
end;
Wnd := GetWindow(Wnd, gw_hWndNext);
end;
end;
Таким образом я получаю список запущенных программ. А вот как показать рядом с ними иконки не знаю. 
|