Re: Tray Icons and custom shell



Yup. You got it all right.
This method has been used quite extensively in XP/XPe world. However, please always keep in mind that it is not 100% bullet-proof
approach since some windows can implement non-standard mechanisms for communicating with sys-tray icons (from directly sending
messages to SysTray to forwarding WM_COMMAND event to some other parts or windows of the same app). Also, since you make use of
undocumented messages it may be changed in future versions of the OS and/or apps.

--
=========
Regards,
KM

KM,

I've played something with "Spy++" and the tray icon application and
explored a lot. When I click the icon, a poup menu is displayed which gives
access to all features of the Wlan stick. Every menu item sends a WM_COMMAND
to a non visible window and every item has a distinct command-ID send in
wParam. So it was not very difficult to write a little app, which uses
PostMessage to send the appropriate command to the tray icon window. The
window name I got from Spy, so I could call FindWindow to get the window
handle. Now I'm able to simulate a click on every menu item from the tray
icons popup menu. That's absolutely perfect. I think this method should work
for many other applications, which hide in the system tray. So it is a really
good solution.

Thank you very much for your assistance,
Klaus


"KM" wrote:

Klaus,

Whether you can launch an app from command line or not, completely depends on the app implementation.

It is possible to hide the SysTray but still have the Explorer running in background as a shell. Your custom shell app just needs
to
be launched automatically by the Explorer. Some techniques I mentioned here:
http://km-dev.blogspot.com/2007/03/xpe-tip-6-completely-hide-taskbar.html. The down side is that launching Explorer shell
increases
the boot time and the footprint of the image in RAM and on disk. It also opens up a security hole in case PC experience is an
issue
for your device. Basically you can "disable" Desktop but still have the Taskbar with Notification Area (SysTray) working.

Perhaps it is easier for you find out what command is launched when that systray icon is activated and used. Basically monitor
that
application window with a tool like MS Spy++ on the XP Pro install. Very likely that by double-clicking on the icon or by
selecting
a context menu item for that icon a message is send to the main window of the app (WM_COMMAND or such). You can always send that
message from your custom app and this way invoke the functions you are looking for.

Often (e.g., for Microsoft components) an item in the context menu for an icon in SysTray launches a control panel applet (with
rundll32 command line). Maybe the same interface is implemented for the WLan driver you are playing with.

--
=========
Regards,
KM


Hello,

I've a custom shell and therefore no system tray. I installed a 3rd party
application for WLAN USB Stick, which normally displays a try icon to access
the app and configure the Wlan stick. Now I'm not able to launch the
appropriate application because without system tray the tray icon ins't
visible. Is it possible to launch applications hiding in system tray
programmatically or from command shell (cmd.exe)? Or on the other hand is it
perhaps possible to display the system tray with a custom shell?

Thanks in advance,
Klaus





.



Relevant Pages

  • Re: perltray/tk intercept windows minimize function
    ... the system tray by interacting with the system tray icon as opposed to a ... double clicking the system tray icon redraws ... withdraws the main window and that sends an event to the application. ... Application can however withdraw the _icon_. ...
    (comp.lang.perl.tk)
  • Problems hiding the main form and displaying only a tray icon
    ... I want my application to run most of the time as just an notify icon ... visible in the system tray, with some dialogs windows that open if the user ... FixedToolWindow then it was no longer visible in the Alt-Tab menu, ... title bar the window expands to its normal size, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problems hiding the main form and displaying only a tray icon
    ... > I want my application to run most of the time as just an notify icon> visible in the system tray, with some dialogs windows that open if the> user selects an option from the context menu on the tray icon. ... It was all fine until I noticed that the> form was visible in the Alt-Tab menu and once you had alt-tabbed to it> there was no way of hiding it again:(> ... > But today I have noticed that now I can no longer minimize or hide the> form it appears as a minizied tool window in the bottom left of my desktop> when the application is running and even worse if the user double clicks> on the title bar the window expands to its normal size, apart from the> form is empty and there's no way to minimize it again! ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: God I hate Spotlight
    ... He said there was a triangle under the icon in the dock (and ... then the window appeared (that reminds me to install the ... icon in the dock and how to open a new 'window' if the app is still ...
    (uk.comp.sys.mac)
  • Re: system tray icons lost if explorer shuts down/re-starts
    ... >only be shown by clicking the icon in the systray. ... >the app ensures that it's the only instance running to prevent having ... >when it re-starts the icon is no longer in the system tray but the app is ...
    (microsoft.public.vb.controls)