Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1997-06-03
10
Medium Priority
?
444 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Accepted Solution

by:
sleach earned 200 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

722 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