Hi there
I have a trayicon that when I hover over it gives the programmed info.
Now what I want to do is if I right click over the tool tip and change the info without any delay.
I capture the right click over the icon I then change the tooltip info but I cannot seem the get the message to change to the new info.
Anybody has any idea what how it can be done?
thanx
Bert
Are you changing the tooltip info or the trayicon's tooltip info? Should be changing the trayicon's tooltip info. My Webserver does this every tick of a trackbar control and on next hover the info is changed in realtime. This should work since on right click the tip is gone and on next hover it will be after you change it on the right click.
I think I am tring to change the trayicon tooltip info. I must be doing something wrong since I cannot change it unless the mouse moves somewhere else and then comes back and reshows the tooltip.
What I am trying to do is change the info dynamically so for example the info would change on a right click.
thanx
bert
So, it does change...but as I mentioned where you won't see it till you hover again? This is normal. To get what you want you'll probably want no tooltip on it and make your own in code on mouseover/rightclick and update it. I have some sample code here and at PB's site I just posted the most recent again for creating tooltips. If you have XP, my 2nd balloon style can be a balloon that stays. Otherwise you can modify it to make a non-balloon that stays too (May already do it normal if no balloon present, I'll have to look), that way you can change it on right click and it stays there till some other condition and then you can hide it yourself in code.
Just looked at code, and the balloon style 2 will make the style for both types of tooltips and use balloon if available. You can change it to not use balloons at all if you want.
You'll then just need- TTM_TRACKPOSITION and TTM_TRACKACTIVATE to set the tip's position and show it.
Thanx Roger
I have been trying to get your function to work the way I want. But I hit a wall when I try to make it appear with my window closed. Actually the program I am working on is a replica of Popwiz. So really except for configuration there never is a window opened.
Right now if I hover the tray icon the tooltip display how many messages are in each mailbox.
If I left click on the trayicon the config window appears -- works good
If I right click on the trayicon I want a new tooltip showing the message title and sender that are each mailbox.
Function ToolTipSet(prevTip , hWnd, hCtrl, sText,BalloonStyle,Title,IconPic)
The problem is what do I do with hWnd and hCtrl when no window is opened.
I have made a 2nd form that would appear when right click and it works but I was trying to have something nicer looking since no input is ever required.
Bert
Perhaps the desktop which I believe is 0, or the window handle of the tray, and/or the handle of the icons which is a toolbar window. Winspector Spy will help you out a lot.