Solved

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

Posted on 1997-06-03
10
433 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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
 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 60
Delphi Dbf export problem to a Visual Foxpro application 6 190
FMX enumerated colours 2 101
Connection between libmysql.dll and MySQL Versions 7 99
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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