Solved

ICON - Change minimized icon on the fly.. Delphi 1

Posted on 1997-06-03
10
427 Views
Last Modified: 2010-04-06
How do I change the icon that shows when an app is minimized?  I want the app to change its own icon while it is running (minimized) whenever an event occurs.  The Application.Icon property sure looks like the obviuos, but it only seems to work if the app has never been minimized.  If the app has ever been minimized, it has no effect thereafter.

For example, want I want to do is show when mail has arrived by changing the app's minimized icon.
0
Comment
Question by:icampbe1
  • 5
  • 3
  • 2
10 Comments
 

Expert Comment

by:richweed
ID: 1336781
Try the following code for animating an icon:

Create a timer control on the form.

place the following code in the timer event:

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if x = 0 then application.icon.loadfromfile('c:\transfer\shipping.ico')
  else application.icon.loadfromfile('c:\transfer\skyline.ico');
x := not x;
end;

Don't forget to declare x : integer in the global var section.

There are more elegant ways to do this, but this should get you going - Add a comment if you need more help or if you want to do more frames.

Cheers
Richard
0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336782
Hi Richard,

That's how I started.  Have you tried it?   Here's whats funny....

After the app has been minimized (at least once) then the icon never changes again..

Try it and let me know..

Thanks,   Ian C.

0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336783
Hi again Richard,

I'm gonna reject the answer for the moment.  Read my previous comment.  I need a solution so I have to unlock the question and hope someone can help in my hour of need :)

Thanks,    Ian C.

0
 
LVL 1

Accepted Solution

by:
sleach earned 100 total points
ID: 1336784
Post your e-mail address, and I will send you an example application that demonstrates how to do this in both Win95 & win3.1 (The techniques are different).


0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336785
OK, I would really like to see what you have.. I'm going nuts here with this one.  For this problem, E-mail me at this address.

 icampbe1@rci.rogers.com    (sic)   {thats a 1(one), not l(ell)}
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Expert Comment

by:richweed
ID: 1336786
Is that for 3.1?

I don't seem to be able to duplicate your problem! Mine works fine.

Any comments sleach?
0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336787
It's a 16 bit app and it must run on both Win95 and Win3.1 workstations.  On a 3.1 workstation, it almost works but you have to invalidate the screen icon by covering it up and then uncovering it to see the new icon.  I want the icon that represents the minimized application to change.  If you think you got something, I would sure like to see it!

Thanks again,
Ian C.

0
 
LVL 1

Expert Comment

by:sleach
ID: 1336788
I sent you the example last night.  Did it do the trick?
0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336789
I really appreciate your quick response.  The answer is yes and no.  It worked like a champ on a 16 bit (Win3.1) workstation.  It didn't work on the Win95 workstation.  Same problem... once an app has been minimized, its minimized icon never changes again.  You can see the icon changing in the Alt+Tab sequence etc..  but not in the minimized icon.  I'm gonna give you a 'C' for your effort but I still need a Win95 solution.

Ian C.

0
 
LVL 1

Expert Comment

by:sleach
ID: 1336790
You might want to try it on another Win95 machine.  I run Win95, and tested the demo app for the problem you describe, and it works fine while switching back and fourth between minimized and maximized states.  I switched about 8 times just to make sure.  Hope you find the problem soon.  
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

707 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

15 Experts available now in Live!

Get 1:1 Help Now