Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

How can I find all programs names on the taskbar?

I don't want to find all process names.
Only names of showing application on taskbar.
How can I get?
0
simawb
Asked:
simawb
1 Solution
 
bernaniCommented:
Put a button and a memo on a form and test this:

function EnumWindowsProc (Wnd: HWND; LParam: LPARAM): BOOL; stdcall;
var
Title : PChar;
begin
  Result := True;
  if (IsWindowVisible(Wnd) or IsIconic(wnd)) and
      ((GetWindowLong(Wnd, GWL_HWNDPARENT) = 0) or
      (GetWindowLong(Wnd, GWL_HWNDPARENT) = GetDesktopWindow)) and
     (GetWindowLong(Wnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW = 0) then
  begin
    Title:=StrAlloc(255);
    GetWindowText(Wnd,Title,255);
    Form1.Memo1.lines.add(StrPas(Title));
    StrDispose(Title);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  EnumWindows(@EnumWindowsProc,0);
end;
0
 
simawbAuthor Commented:
thank you so much bernani !
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now