when you hover the mouse on your system tray application. how do you change its
display text. as in like your program has a "running" or "idle" plus changing the icon dynamically??
thanks!
A simple way would be to catch the WM_MOUSEMOVE message within your tray notification message - this will tell you that the mouse pointer is over your icon, and the tooltip may be shown at this point. So then you can set the tooltip's text (NOTIFYICONDATA.szTip) through Shell_NotifyIcon.
A possible alternative would be if you could catch TTN_GETDISPINFO, which is sent inside WM_NOTIFY -- though I haven't tested this, so I'm not sure if you will even get to see this message.
thanks Tedd, but i guess ill try the hard way,
does someone have a short sample code for this??
Let me see if I can explain this so it will be fully understanable.
the below code is how you would create a shell notify,notic the NIM_ADD
when you get the WM_SHELLNOTIFY message place this same code in there but change NIM_ADD to NIM_MODIFY
then just change the tooltip and icon. you will get this message also under WM_MOUSEMOVE
mov note.cbSize,sizeof NOTIFYICONDATA
push hWin
pop note.hwnd
mov note.uID,IDI_TRAY
mov note.uFlags,NIF_ICON+NIF_MESSAGE+NIF_TIP
mov note.uCallbackMessage,WM_SHELLNOTIFY
mov eax,hIcon
mov note.hIcon,eax
invoke lstrcpy,addr note.szTip,addr szDisplayName
invoke Shell_NotifyIcon,NIM_ADD,addr note
If this is not clear to you, let me know and I will try to make a simple program to show how this is done.
Zcoder....
Thanks! yes but i already got this,
i think i have another problem re this, how do you animate the tray icon?
you just load and load and change it alternately like flipping or animation?
and also the Balloon help in ME and XP systems... what command is that???
like when you first install XP there's a balloon saying "Take a tour on Windows XP" on the tray icon..
:bg
bloodhound,
You might take a look at the code for the three HDD activity monitors that have been posted, one by me, and now two much better ones by Phoenix. The attachment is a version with a 5-step animated icon that I rejected because of unacceptable flicker under Windows 2000.
[attachment deleted by admin]
MichaelW,
That example is not really done the right way, also the timer is too fast should be 1000 for 1 sec.
to avoid flicker, but it still is not done right.
also a clue to the balloon tooltip:
uFlags = NIF_INFO
Use a balloon ToolTip instead of a standard ToolTip. The szInfo, uTimeout, szInfoTitle, and dwInfoFlags members are valid.
Zcoder....
@ MichaelW
Ok, Thanks a lot! i will check it and see how it works, BTW my system is ME.
@zcoder
can you give me details or a small example on this balloon tip? thanks! :thumbu
@Zcoder
i dont see any NIF_INFO in my windows.inc, of course compiles with errors
am using masm7...
bloodhound,
When I read the MSDN I did not realize that this stuff is missing from
windows.inc and I tried for over 24 Hours to create a example on
using baloon tooltips, but I could not get it to work. So far to
date this is the only thing I have found in the MSDN that I can't
get to work.
I am sure I will find other things in the MSDN that I can't understand.
SHELLICONDATA has been inlarged with other items in it and some
equates have been add like:
NIF_INFO equ 10h
NIN_BALLOONSHOW equ WM_USER+2
NIIF_INFO equ 1
NOTIFYICON_OLDVERSION equ 0;
NOTIFYICON_VERSION equ 3;
I will have to work on this for awhile to figure this out.
I am adding all this to my windows.inc project as well.
This is the same problem I had with making a web cam
example, but I got that to work so I hope to have this figured out too.
Zcoder....
Balloon tip with thanks to "anon"
[attachment deleted by admin]
hutch-- ,
Thats is the wrong type
we are trying to make shell icon tooltips
you know down by the clock?
Zcoder....
Perhaps this helps:
http://www.codeproject.com/shell/StealthDialog.asp
Thanks to you all guys!!
but i finally got it! oh wow!! :clap:
http://www.masmforum.com/simple/index.php?topic=4679.0