News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

System Tray IP address tooltip display

Started by dsouza123, October 19, 2007, 05:12:16 AM

Previous topic - Next topic

dsouza123

  My intent in combining MyIP.asm and TrayIcon.asm is to create a system tray program
that will show the PC's IP address(es). 
  It currently will display a messagebox with the info either by a single (left) click
or selecting an item on a right click menu.
With just a mouse over the icon the program will get the current IP address(es) and
display them in a tooltip/balloon but I can't get the tip text to change.
  So the tooltip text just says  Click for IP Address(es).

  Any ideas/code to update the tooltip text ?

 

[attachment deleted by admin]

Tedd

I'm sure that code looks familiar :wink
To update the tooltip (or any other element of the tray icon) use the NIM_MODIFY message - just use the same structure as used with NIM_ADD but modify the szTip string.
Alternatively, you could get the ip address(es) first, and then set the tray icon - at which point you'll already have the tooltip text.
I suppose being able to modify it would be better if you want to periodically update the ip address, in case it changes (which may happen if it's dynamically allocated and you get disconnected often.)
No snowflake in an avalanche feels responsible.

dsouza123

Thanks Tedd for the MyIP.asm source. 

I knew it was from somewhere on the MASM forum but I couldn't find the post,
search doesn't include the filenames of attachments (MyIP.zip in this case),
so I listed the source filename instead for attribution.
I hoped the author might step forward. :bg

Thanks for the NIM_MODIFY answer, now to find the appropriate spot in the code
to detect mouse overs and refresh the IP text.

dsouza123

An improved version, still needs a click (left or right, right gives a right click menu)
to cause the program to recheck the IP(s).

It starts by getting the IP(s) so it has current info at program startup.
If an IP is removed (dialup) or changed, it wont be reflected unless a click is done.

The problem now is how to get a single mouse over so it wont keep rechecking.

[attachment deleted by admin]

Cobra

Are there any examples for obtaining the external IP?

Tedd

No snowflake in an avalanche feels responsible.