Getting the hint off a tray icon?

delphi package - easy access to kernel objects etc.
Post Reply
xHeaps
Posts: 17
Joined: Mon Oct 18, 2004 12:21 am

Getting the hint off a tray icon?

Post by xHeaps »

Hello.

I wonder if it is possible to capture the hint that is appearing when a mouse moves over a tray icon?

I would like to get, for example, the hint of Azureus BitTorrent client, which shows the current download/upload speed. Is there any way to do it with?

I'm thinking: Process("azureus.exe").TrayIcons.....

(I'm using Delphi, btw).

Thanks in advance.
xHeaps
Posts: 17
Joined: Mon Oct 18, 2004 12:21 am

Post by xHeaps »

Never mind, found it :)

I was trying to access the wrong process. The Azureus BitTorrent client is java-based, so the main executable is basically 'javaw.exe' instead of 'Azureus.exe'.

So if anyone wonders, I did it like this:

Code: Select all

var s: string;
begin
  s:=  Process('javaw.exe').TrayIcons.Items[0].Hint;
end;  
:crazy:
xHeaps
Posts: 17
Joined: Mon Oct 18, 2004 12:21 am

Post by xHeaps »

But yet another question (woo, what a morning :))

Can I capture the hint off a program when it has no icon in the system tray (e.g. on the taskbar only)?

Thanks in advance :)
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I guess that the Explorer shows the title of the main window as the taskbar button hint. But that's only a guess. Anyway, you could try exactly that:

Process('xxx.exe').TaskbarWindows[0].Text;
xHeaps
Posts: 17
Joined: Mon Oct 18, 2004 12:21 am

Post by xHeaps »

Yup, that's exactly what I needed! Thank you madshi!

And if I may, another quick question (sorry for the spam :))

Is there any way I can get the full hint, if it has more then 255 chars in length?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The full hint of what? The tray icon or the taskbar button?
Post Reply