Solved

Easy way to hide taskbar icon on minimize?

Posted on 1998-09-18
13
635 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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
 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

18 Experts available now in Live!

Get 1:1 Help Now