Hi All !!

Does anybody know how to update the tooltip text of an icon in the traybar ?
I have a timer and every second, i need to update the text...
My line invoke Shell_NotifyIcon,NIM_MODIFY,addr TrayStruct produce no result.
The only solution is maybe to create manually the tooltip and attach it to the icon !!??



:confused: HELP :confused:
Posted on 2002-01-24 09:31:14 by PhoBos
Hi,
I can't help you because I've never thought about it, but you should ask that at the main forum. Because I don't think that all the people go to all the forum. (I can say that because not to lose a lot of time, I just watch the main forum, and somtimes the others)

D?sol? de pas t'avoir aid?, enfin, j'avais fait un prog qui faisait ?a, but I just changed the caption of the window, and that changed the tooltip sec per second, but it didn't refresh from its own.
Posted on 2002-01-24 13:59:49 by Vom-bonjour:-()
Sorry, I thought this message was on the Algo forum. Did a moderator move this message, or was I dreaming:rolleyes: .
Posted on 2002-01-24 14:33:27 by Vom-bonjour:-()
:grin: Vom-bonjour:-(), your not dreaming - I just followed your good advice and put the message here. :grin:
Posted on 2002-01-24 14:40:31 by bitRAKE
PhoBos,

If you mean the tooltip that shows up while
hovering over your programs button on the "taskbar"
you can use:

invoke SetWindowText, hWnd, ADDR jact

to change the text in the title bar which will
also show up on the tooltip. Is that what you
wanted?

farrier
Posted on 2002-01-24 14:49:17 by farrier
Here is the code I usually use, it is in C, sorry :grin:.
/************************************

* TaskBarModifyIcon: modify the icon in the TNA
* hwnd - handle of the window to receive callback messages
* uID - identifier of the icon
* hicon - handle of the icon
* lpszTip - tooltip text
*************************************/
BOOL TaskBarModifyIcon (HWND hWnd, UINT uID, HICON hIcon, LPSTR lpszTip)
{
NOTIFYICONDATA tnid ;

tnid.cbSize = sizeof(NOTIFYICONDATA) ;
tnid.hWnd = hWnd ;
tnid.uID = uID ;
tnid.uFlags = 0 ;
if (hIcon)
{
tnid.uFlags |= NIF_ICON ;
tnid.hIcon = hIcon ;
}
if (lpszTip)
{
tnid.uFlags |= NIF_TIP ;
lstrcpyn (tnid.szTip, lpszTip, sizeof(tnid.szTip)) ;
}
return Shell_NotifyIcon (NIM_MODIFY, &tnid) ;
}

The only error I can think about is that you didn't update the uFlags field with NIF_TIP value.
Posted on 2002-01-24 15:01:43 by LuHa
bitRAKE: I really thought I became mad:grin:
farrier: That was what I said when I said you can change the caption of the window (with SetWindowText as you said) but the problem with that is that when the tooltip is displayed, it is not refreshed itself, you've got to leave the tooltip and then display the tooltip again (with moving the cursor on the tray icon).
So maybe PhoBos should create it manually, I don't really know.

Thanks bitRAKE, I'm not dreaming, so I can now do my homework. (it's 22h11 and it's for tomorrow) but you don't care:alright:
Posted on 2002-01-24 15:02:17 by Vom-bonjour:-()
Ah!, LuHa posted the message while I was writing the provious one :alright: :alright:
Posted on 2002-01-24 15:03:22 by Vom-bonjour:-()
Bonne chance a ta devoirs! :)
Posted on 2002-01-24 15:12:22 by TCT
Vom-bonjour:-(),


but the problem with that is that when the tooltip is displayed, it is not refreshed itself, you've got to leave the tooltip and then display the tooltip again (with moving the cursor on the tray icon).


In my alarm-clock/countdown-timer/stopwatch
program, jacts.asm, I use the SetWindowText to
update the title bar and tooltip. The text is
updated by a 1 second timer and if I keep the
mouse on the taskbar button, the tooltip updates
every second, Win95. But I think LuHa has the
better solution! Thanks!

farrier
Posted on 2002-01-24 15:27:49 by farrier
Hi all !

Thank you for your replies.
As you can see, i used the same solution than LuHa...
Curretly i'm trying to create the tooltip manually to see if it works better... :rolleyes:

Sending results later.
Tx again...
Posted on 2002-01-25 03:42:48 by PhoBos