?
Solved

Easy way to hide taskbar icon on minimize?

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

Thanks
0
Comment
Question by:ripcord
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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