Tech Support > Microsoft Windows > Development Resources > TrayIcon
TrayIcon
Posted by salvage on April 16th, 2004


Hi,

I have a thirdpart application running as a little icon in the tray - when i
rightclick this, i get a popup menu with an "Enable" / "Disable" checkbox.

I would like to do this programatically - to "enable" / "disable" this
application from my application.

Do any of you have a good advice on how to do this ? - is it possible to
send a message or something to this application - and how do i locate it
(since it running in the tray).

Thanks



Posted by Elias Fotinis on April 16th, 2004


salvage wrote:
Use something like Spy++ to monitor WM_COMMAND messages and select the
menu command on the tray icon once. This way you'll find out the command
id and the destination window's handle. Locate the window from it's
handle and you'll get it's title and class.

In you app, use FindWindow() and family to find the window with the
proper title and class and post a WM_COMMAND with a command id to it.


Posted by Raymond Chen on April 16th, 2004


You'll have to check the documentation for the thirdparty
application, see if it exposes an API for enabling and disabling
programmatically.

On Fri, 16 Apr 2004 12:47:56 +0200, "salvage"
<grev@grevspamno.no> wrote:

Posted by Dilton McGowan II on April 17th, 2004


"salvage" <grev@grevspamno.no> wrote in message
news:407fb9e2$0$196$edfadb0f@dread11.news.tele.dk. ..
If there's a way to find the window handle for the menu, you should be able
to send it a message I think.


Posted by Angus Comber on April 17th, 2004


If you have VC++ you can use Spy++ to find the Window name.

Then you could use FindWindow function to Find the Window.

Then use SendMessage to send a message to do whatever to the program.

In reality it will probably be a lot more complex than this but hope that
helps.

Angus Comber
angus@NOSPAMiteloffice.com


"Dilton McGowan II" <nospam@nospam.net> wrote in message
news:S56dnYgQ6KihUh3dRVn-jw@comcast.com...



Similar Posts