Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

my system tray icon's tooltip is not updating.

Posted on 2000-03-19
10
Medium Priority
?
467 Views
Last Modified: 2012-05-04
Hi,

  I'm using a system tray icon.  I can add the icon to the tray just fine and whatever nid.szTip was set to show up just dandy as the tooltip.
  I would like the tooltip to change.  I've tried changing nid.szTip and then calling Shell_NotifyIcon(NIM_MODIFY, nid), which is set to

Public Declare Function Shell_NotifyIcon Lib "SHELL32" _
(ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean

Public Const NIM_MODIFY = &H1

What am I doing wrong here?

Removing the icon works fine too.

tia.
0
Comment
Question by:lmathers
[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
  • 5
10 Comments
 
LVL 14

Expert Comment

by:mcrider
ID: 2633432
Do you have nid defined as public?

   Public nid As NOTIFYICONDATA

If not, it needs to be... Then you do this:

   nid.szTip = "My New Tip" & vbNullChar
   Shell_NotifyIcon NIM_MODIFY, nid


Cheers!®©
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2633441
Also, see the following microsoft KB article:

HOWTO: Use the System Tray Directly from Visual Basic
http://support.microsoft.com/support/kb/articles/Q176/0/85.ASP?LNG=ENG&SA=MSDN&FR=0 


Cheers!®©
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2633447
This microsoft KB article is also QUITE HELPFUL!

HOWTO: Manipulate Icons in the System Tray with Visual Basic
http://support.microsoft.com/support/kb/articles/Q162/6/13.asp?LNG=ENG&SA=MSDN&FR=0 


Cheers!®©
0
Technology Partners: 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!

 

Author Comment

by:lmathers
ID: 2633489
Well, yes nid is public

Public nid As NOTIFYICONDATA

and here is the code I'm using to update the icon.

nid.szTip = "blah" & vbNullChar
Shell_NotifyIcon NIM_MODIFY, nid

I have read the ms docs on dealing with system tray icons.  In fact, I've pretty much copied their stuff.  However, it's still not working.

Shell_NotifyIcon returns true when I execute the above.  Meanwhile, the tooltip is not being updated.

0
 
LVL 14

Expert Comment

by:mcrider
ID: 2633532
Bizzare!  Can you run the example in:

HOWTO: Manipulate Icons in the System Tray with Visual Basic
http://support.microsoft.com/support/kb/articles/Q162/6/13.asp?LNG=ENG&SA=MSDN&FR=0 

By the way, that example requires a CommonDialog control to be added to the form in addition to the 2 command buttons. (The article fails to mention this)

Run the example and then click the "Add an Icon" button.  Then go down to the System Tray and hover over the new icon.

You should see: "Taskbar status area Sample Program"

Right click on the icon and a change the tip, then hover over it again...

If you can get this working, then something is definately wrong with your program and you will need to post the source...


Cheers!®©
0
 

Author Comment

by:lmathers
ID: 2633673
Well, I was hoping it was something wrong with my program, but....

I copied the source code and created the project.

I right-clicked on the icon, filled in a random string into the box that popped up and the tooltip still says:
"Taskbar Status Area Sample Program".

Is this time for me to say uh-oh?
0
 
LVL 14

Accepted Solution

by:
mcrider earned 150 total points
ID: 2633906
If you built the program *EXACTLY* as the MS article said to and the tooltips didn't change, it's time for a BIG UH-OH!

What version of VB are you using??  If you are using VB5 or VB6, you need to have Service Pack 3 installed...

See the following MS article:

INFO: Visual Studio 97 Service Packs - What, Where, and Why
http://support.microsoft.com/support/kb/articles/Q170/3/65.ASP 


Cheers!®©
0
 

Author Comment

by:lmathers
ID: 2633960
ARGH!

I'm running VB6 SP3.

I just solved the problem.

I restarted my computer, now it works perfectly.

How, so very microsoft!

Thank you for your time.
0
 

Author Comment

by:lmathers
ID: 2633961
Thanks for taking time to help out.
0
 

Author Comment

by:lmathers
ID: 2633969
I did try just restarting VB, so it was a logoff/logon or restart that fixed the problem, whatever it might have been.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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…
Suggested Courses

609 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