Board index » delphi » hiding taskbar icon in win98

hiding taskbar icon in win98

hi, i have tried to hide the taskbar icon with no success under windows
98... i have tried 2 or 3 different ways, one being from inprise's online
help... has anybody figured or have any idea how to do this? below is the
helpfile from inprise...

loc

----- cut -----

Question:
How do I hide my application from the Windows Taskbar?
Answer:
To do this you will need to:

Select the View -> Project Source, from Delphi's main menu.

Add the Windows unit to the uses clause.

Add Application.ShowMainForm := False; to the line after
"Application.Initialize;".

Add: ShowWindow(Application.Handle, SW_HIDE); to the line
before "Application.Run;"

Your main project source file should now look something like
this:

program Project1;

uses
  Windows,
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.ShowMainForm := False;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  ShowWindow(Application.Handle, SW_HIDE);
  Application.Run;
end.

In the "initialization" section (at the very bottom)
of each unit that uses a form, add:

begin
  ShowWindow(Application.Handle, SW_HIDE);

----- cut -----
end.

--
----------------------------------------
remove .nospam from my address if
replying via email...

 

Re:hiding taskbar icon in win98


hi, i have tried to hide the taskbar icon with no success under windows
98... i have tried 2 or 3 different ways, one being from inprise's online
help... has anybody figured or have any idea how to do this? below is the
helpfile from inprise...

loc

----- cut -----

Question:
How do I hide my application from the Windows Taskbar?
Answer:
To do this you will need to:

Select the View -> Project Source, from Delphi's main menu.

Add the Windows unit to the uses clause.

Add Application.ShowMainForm := False; to the line after
"Application.Initialize;".

Add: ShowWindow(Application.Handle, SW_HIDE); to the line
before "Application.Run;"

Your main project source file should now look something like
this:

program Project1;

uses
  Windows,
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.ShowMainForm := False;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  ShowWindow(Application.Handle, SW_HIDE);
  Application.Run;
end.

In the "initialization" section (at the very bottom)
of each unit that uses a form, add:

begin
  ShowWindow(Application.Handle, SW_HIDE);

----- cut -----
end.

--
----------------------------------------
remove .nospam from my address if
replying via email...

Re:hiding taskbar icon in win98


hi, i have tried to hide the taskbar icon with no success under windows
98... i have tried 2 or 3 different ways, one being from inprise's online
help... has anybody figured or have any idea how to do this? below is the
helpfile from inprise...

loc

----- cut -----

Question:
How do I hide my application from the Windows Taskbar?
Answer:
To do this you will need to:

Select the View -> Project Source, from Delphi's main menu.

Add the Windows unit to the uses clause.

Add Application.ShowMainForm := False; to the line after
"Application.Initialize;".

Add: ShowWindow(Application.Handle, SW_HIDE); to the line
before "Application.Run;"

Your main project source file should now look something like
this:

program Project1;

uses
  Windows,
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.ShowMainForm := False;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  ShowWindow(Application.Handle, SW_HIDE);
  Application.Run;
end.

In the "initialization" section (at the very bottom)
of each unit that uses a form, add:

begin
  ShowWindow(Application.Handle, SW_HIDE);

----- cut -----
end.

--
----------------------------------------
remove .nospam from my address if
replying via email...

Re:hiding taskbar icon in win98


On Fri, 31 Jul 1998 02:00:06 -0600, "loc" <l...@sd5.k12.mt.us.nospam>
wrote:

Quote
>hi, i have tried to hide the taskbar icon with no success under windows
>98... i have tried 2 or 3 different ways, one being from inprise's online
>help... has anybody figured or have any idea how to do this? below is the
>helpfile from inprise...

Put this in the OnCreate event for your main form:

var
   FullRgn, ClientRgn, ButtonRgn: THandle;
  Margin, X, Y: Integer;
  r:boolean;
begin
 //Make form invisible
  top:=screen.Height-50;
  left:=screen.width-120;
  Margin := (Width - ClientWidth) div 2;
  FullRgn := CreateRectRgn(0, 0, Width, Height);
  X := Margin;
  Y := Height - ClientHeight - Margin;
  ClientRgn := CreateRectRgn(X, Y, X + ClientWidth, Y + ClientHeight);
  CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
  CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR);
  SetWindowRgn(Handle, FullRgn, True);
  //Hide Taskbar Icon
  ShowWindow( Application.Handle, SW_HIDE );
  SetWindowLong( Application.Handle, GWL_EXSTYLE,
                 GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                 WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
  ShowWindow( Application.Handle, SW_SHOW );

Spence
'98 YZ250
'93 KDX200

http://www.dialnet.net/users/spence/

The opinion stated above is my own.  
Any semblance to a cognitional statement is fortuitous.

Re:hiding taskbar icon in win98


thank you... it worked!

loc

Quote
Padre wrote:
> On Fri, 31 Jul 1998 02:00:06 -0600, "loc" <l...@sd5.k12.mt.us.nospam>
> wrote:

> >hi, i have tried to hide the taskbar icon with no success under windows
> >98... i have tried 2 or 3 different ways, one being from inprise's online
> >help... has anybody figured or have any idea how to do this? below is the
> >helpfile from inprise...

> Put this in the OnCreate event for your main form:

> var
>    FullRgn, ClientRgn, ButtonRgn: THandle;
>   Margin, X, Y: Integer;
>   r:boolean;
> begin
>  //Make form invisible
>   top:=screen.Height-50;
>   left:=screen.width-120;
>   Margin := (Width - ClientWidth) div 2;
>   FullRgn := CreateRectRgn(0, 0, Width, Height);
>   X := Margin;
>   Y := Height - ClientHeight - Margin;
>   ClientRgn := CreateRectRgn(X, Y, X + ClientWidth, Y + ClientHeight);
>   CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
>   CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR);
>   SetWindowRgn(Handle, FullRgn, True);
>   //Hide Taskbar Icon
>   ShowWindow( Application.Handle, SW_HIDE );
>   SetWindowLong( Application.Handle, GWL_EXSTYLE,
>                  GetWindowLong(Application.Handle, GWL_EXSTYLE) or
>                  WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
>   ShowWindow( Application.Handle, SW_SHOW );

> Spence
> '98 YZ250
> '93 KDX200

> http://www.dialnet.net/users/spence/

> The opinion stated above is my own.
> Any semblance to a cognitional statement is fortuitous.

Other Threads