Solved

Prevent duplication of systray icon

Posted on 2011-09-10
2
271 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 46

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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