Solved

Prevent duplication of systray icon

Posted on 2011-09-10
2
276 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
[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
2 Comments
 
LVL 47

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

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!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

688 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