The MASM Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 03, 2010, 04:57:27 am

Login with username, password and session length
Search:     Advanced search
116888 Posts in 13958 Topics by 1631 Members
Latest Member: anglear_
* Home Help Search Login Register
+  The MASM Forum
|-+  General Forums
| |-+  The Workshop
| | |-+  Dynamically changing system tray icon and the on hover text display??
« previous next »
Pages: [1] Print
Author Topic: Dynamically changing system tray icon and the on hover text display??  (Read 1552 times)
bloodhound
Member
****
Gender: Male
Posts: 52


they dont call me bloodhound for nothing!


Dynamically changing system tray icon and the on hover text display??
« on: April 27, 2006, 02:01:54 pm »

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!
Logged
Tedd
Procrastinator Extraordinaire
Member
*****
Posts: 1919


Reality Bytes


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #1 on: April 27, 2006, 02:54:10 pm »

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.
Logged

No snowflake in an avalanche feels responsible.
bloodhound
Member
****
Gender: Male
Posts: 52


they dont call me bloodhound for nothing!


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #2 on: April 28, 2006, 03:17:03 am »

thanks Tedd, but i guess ill try the hard way,

does someone have a short sample code for this??
Logged
zcoder
Member
*****
Gender: Male
Posts: 187



Re: Dynamically changing system tray icon and the on hover text display??
« Reply #3 on: April 28, 2006, 04:36:50 am »

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

Code:
         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....
Logged

Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names
bloodhound
Member
****
Gender: Male
Posts: 52


they dont call me bloodhound for nothing!


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #4 on: April 28, 2006, 07:50:01 am »

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..
BigGrin
Logged
MichaelW
Global Moderator
Member
*****
Gender: Male
Posts: 4240


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #5 on: April 28, 2006, 09:14:35 am »

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.


* hdactmon_a.zip (6.05 KB - downloaded 148 times.)
Logged

eschew obfuscation
zcoder
Member
*****
Gender: Male
Posts: 187



Re: Dynamically changing system tray icon and the on hover text display??
« Reply #6 on: April 28, 2006, 10:23:43 am »

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....
Logged

Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names
bloodhound
Member
****
Gender: Male
Posts: 52


they dont call me bloodhound for nothing!


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #7 on: April 28, 2006, 01:13:50 pm »

@ 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! ThumbsUp
Logged
bloodhound
Member
****
Gender: Male
Posts: 52


they dont call me bloodhound for nothing!


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #8 on: April 30, 2006, 02:55:27 am »

@Zcoder


i dont see any NIF_INFO in my windows.inc, of course compiles with errors
am using masm7...
Logged
zcoder
Member
*****
Gender: Male
Posts: 187



Re: Dynamically changing system tray icon and the on hover text display??
« Reply #9 on: April 30, 2006, 12:52:49 pm »

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....
Logged

Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names
hutch--
Administrator
Member
*****
Posts: 9558


Mnemonic Driven API Grinder


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #10 on: April 30, 2006, 12:55:35 pm »

Balloon tip with thanks to "anon"

* BalloonTips.zip (2.52 KB - downloaded 126 times.)
Logged

Regards,



Download site for MASM32
http://www.masm32.com
zcoder
Member
*****
Gender: Male
Posts: 187



Re: Dynamically changing system tray icon and the on hover text display??
« Reply #11 on: April 30, 2006, 01:00:08 pm »

hutch-- ,
Thats is the wrong type
we are trying to make shell icon tooltips
you know down by the clock?

Zcoder....
Logged

Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names
Phoenix
Member
*****
Gender: Male
Posts: 136



Re: Dynamically changing system tray icon and the on hover text display??
« Reply #12 on: April 30, 2006, 01:23:03 pm »

Logged

Go the extra mile. It's never crowded...
bloodhound
Member
****
Gender: Male
Posts: 52


they dont call me bloodhound for nothing!


Re: Dynamically changing system tray icon and the on hover text display??
« Reply #13 on: May 02, 2006, 06:44:19 am »



Thanks to you all guys!!

but i finally got it!  oh wow!! clap



http://www.masmforum.com/simple/index.php?topic=4679.0
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!