Solved

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

Posted on 1997-06-03
10
441 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
[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
  • 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
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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month4 days, 12 hours left to enroll

635 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