Solved

Easy way to hide taskbar icon on minimize?

Posted on 1998-09-18
13
632 Views
Last Modified: 2010-05-18
How do I hide the taskbar icon on minimize?

Thanks
0
Comment
Question by:ripcord
  • 6
  • 2
  • 2
  • +2
13 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1340189
What do you call a taskbar icon??

//Vik
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1340190
ripcord,

if you mean the taskbar button, just call
"ShowWindow(form1.handle,SW_HIDE)"

Regards, Madshi.
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1340191
Or ShowWindow(Application.Handle, SW_HIDE); to remove the project's icon from the Windows Taskbar.

Cheers,
JB
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340192
Hello guys! Any of you know what the Task Icon is??? Do you mean the taskbar button of your app???

Regards,
Viktor Ivanov
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1340193
Hi Viktor

I *think* that ripcord means that the taskbar icon is (as you say) the taskbar button of your app.

JB
0
 

Author Comment

by:ripcord
ID: 1340194
ya I was talking about the taskbar button of my app. I want it to be hidden on minimzie. Then to come back when the from is restored from the tray icon. I've tried the above suggestions with the OnResize event of the form but it doesn't seem to work. This is what I tried, but it doesn't seem like the OnResize gets triggered when clicking on the minimize button.

 If (frmMain.WindowState = wsMinimized) and
    (frmOptions.chkHideTaskbar.Checked = True) Then
    ShowWindow(Application.Handle, SW_HIDE);
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 1340195
Here is what you do....
  private
    procedure MyMin(Sender : TObject);
    procedure MyRes(Sender : TObject);

procedure TForm1.MyMin(Sender : TObject);
begin
    ShowWindow(Application.Handle, SW_HIDE);
end;
procedure TFOrm1.MyRes(Sender : TObject);
begin
    ShowWindow(Application.Handle, SW_RESTORE);
end;

Regards,
Viktor Ivanov
0
 

Author Comment

by:ripcord
ID: 1340196
Ok, but how do I get procedure MyMin(Sender : TObject);  to get exectuted when the user clicks on the min button on the form?
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340197
Add this to your OnCreate() of the form...

Application.OnMinimize := MyMin;
Application.OnRestore := MyRes;

Regards,
Viktor Ivanov
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1340198
Bought This Question.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340199
what?
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1340200
Hi Vik, do you know the automatic "Edited Question" and "Points adjusted to XXX" comments? I guess the "Bought This Question" comment is a new automatic one...   :-)
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340201
Wow, why dont they invent a self answering feature ;-))
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now