• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

How to hide the taskbar icon (button) of another application

I need to write an application that hides the taskbar buttons of other applications.
If anyone has any idea please help me.
0
Rayden_The_God
Asked:
Rayden_The_God
  • 2
1 Solution
 
Rayden_The_GodAuthor Commented:
I'm not intrested in hiding the taskbar , just some application buttons (not all)
I'm also not intrested to hide them anywhere else , I'm just intrested to hide another process-es task button
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
My point of start

Note that this will hide/show any window, so you have to parse and filter them, but it shows how you can access and hide other application form taskbar
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  WindowList: TList;

implementation

{$R *.dfm}

function GetWindows(Handle: HWND; Info: Pointer): BOOL; stdcall;
begin
  Result := True;
  WindowList.Add(Pointer(Handle));
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  TopWindow: HWND;
  Dest: array [0..80] of char;
  i: integer;
begin
  try
    WindowList := TList.Create;
    TopWindow := Handle;
    EnumWindows(@GetWindows, Longint(@TopWindow));
    for i := 0 to WindowList.Count - 1 do
    begin
      GetWindowText(HWND(WindowList[i]), Dest, sizeof(Dest) - 1);
      if StrLen(Dest) > 0 then
        try
          showwindow(HWND(WindowList[i]), sw_show);
        except
          //
        end;
    end;
  finally
    WindowList.Free;
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);

var
  TopWindow: HWND;
  Dest: array [0..80] of char;
  i: integer;
begin
  try
    WindowList := TList.Create;
    TopWindow := Handle;
    EnumWindows(@GetWindows, Longint(@TopWindow));
    for i := 0 to WindowList.Count - 1 do
    begin
      GetWindowText(HWND(WindowList[i]), Dest, sizeof(Dest) - 1);
      if StrLen(Dest) > 0 then
        try
          showwindow(HWND(WindowList[i]), sw_hide);
        except
          //
        end;
    end;
  finally
    WindowList.Free;
  end;
end;

Open in new window

0
 
Rayden_The_GodAuthor Commented:
thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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