Solved

Prevent duplication of systray icon

Posted on 2011-09-10
2
268 Views
Last Modified: 2012-05-12
HI everyone
I've been working on a VB6 app that puts an icon in the systray.

This works fine, but I've noticed that if I execute my app again it puts another same icon in the systray.
How can I prevent this?
What I want is , if the user happens to run the app , I want to check in the systray and only add the icon if it doesnt currently exist...in other words it should only ever be there once.
I guess I need a way to enumerate thru the systray and find my icon ...if its there. Or should I be overwriting the icon with the one recently executed........not sure at this point

Thanks for your help
H
0
Comment
Question by:HenryV1955
2 Comments
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 36516491
Put this in your startup code

If App.PrevInstance Then… 'Indicates that another instance is running

Open in new window

0
 

Author Closing Comment

by:HenryV1955
ID: 36516565
Hi Martin

Yes, I hadnt thought of coming at it this way....feel silly

I accept your answer, it works fine now.

Thank you
H
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 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

24 Experts available now in Live!

Get 1:1 Help Now