Re: API confusion

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



> 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


.



Relevant Pages

  • Re: Whats gone wrong with Free AVG
    ... that there was no icon in the System tray. ... Tray icon from the program list and 2clicked on it, ... file is corrupt', then from the CNET site, but that seems not to be ... any avg processes running? ...
    (uk.people.silversurfers)
  • Re: Whats gone wrong with Free AVG
    ... that there was no icon in the System tray. ... Tray icon from the program list and 2clicked on it, ... I've had problems downloading stuff from Download.com lately. ...
    (uk.people.silversurfers)
  • Re: Making main form initially hidden...?
    ... > can show it as you need (beware off the top of my head code follows): ... > Public Sub Main ... > 'Insert code here to insert icon in system tray ... > 'user clicks your tray icon. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: CPU usage 100% on Dell Inspiron 8100
    ... It places an icon in your system tray that can be used to laucnh ... buttons on Dell Laptop computers. ... If you don't need the tray icon, you can disable it via Winpatrol. ...
    (microsoft.public.windowsxp.general)