Re: API confusion
- From: "Mike Labosh" <mlabosh_at_hotmail.com>
- Date: Wed, 25 Jan 2006 10:46:49 -0500
> I'm not sure you understood me correctly...
>
> I have a program that does the downloading, but it chews up all my
> bandwidth. What i'm looking to do is to create a program that will tell
> the downloader to pause (It has a pause option) when I or anyone on my
> network is using the internet.
>
> My downloader runs in the system tray, and all I have to do is right
> click and 'pause'. I thought that there might be a way to access the
> options via programming.
Yes, I misunderstood. hehe
To send a command to a system tray icon that belongs to another application,
you WILL have to resort to the API. SHELL32.DLL used to have a function
called SHNotifyIcon or ShellNotifyIcon or something like that, but I either
can't think of how it's spelled, or I can't find it in the MSDN index.
On the VB 5.0 Enterprise Edition CD, there was a "Unsupported" folder that
had a code sample for making a system tray icon with the API, and this
function that I can't remember is the way the application had to notify it
of stuff. ...And now I can't even find that disk to go lookup the code
sample.
That's all I know, sorry.
To do it the hard way, you could use FindWindow or GetWindow to find the
hWnd and then try to PostMessage some mouse clicks to it, (kind of like
using SendKeys) but that gets messy, and I'm not sure you could get the hWnd
of a tray icon by passing FindWindow the title text of its window -- because
it's an icon, and doesn't have one.
--
Peace & happy computing,
Mike Labosh, MCSD MCT
"Escriba coda ergo sum." -- vbSensei
.
- Follow-Ups:
- Re: API confusion
- From: AC
- Re: API confusion
- References:
- API confusion
- From: mini chifa
- Re: API confusion
- From: Mike Labosh
- Re: API confusion
- From: mini chifa
- API confusion
- Prev by Date: Re: Multiline comment behavior in VS2005 VB.NET
- Next by Date: using Generics dynamically (?)
- Previous by thread: Re: API confusion
- Next by thread: Re: API confusion
- Index(es):
Relevant Pages
|