[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Prevent duplication of systray icon

Posted on 2011-09-10
2
Medium Priority
?
283 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 50

Accepted Solution

by:
Martin Liss earned 2000 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

834 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