Solved

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

Posted on 1997-06-03
10
430 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

23 Experts available now in Live!

Get 1:1 Help Now