Activate an application which runs in the Sys Tray Notification Area using VBScript

Posted on 2009-12-21
Last Modified: 2012-05-08
I want to Activate an application which is already active but running minimized in the Sys Tray Notification Area through VBScript.  I have tried objcreate but that of course simply creates a new instance of this process instead of invoking the one already running.  I have also looked into AppActivate and GetObject but with no luck so far.

Once we figure out hot to invoke it, I plan to use sendkeys to manipulate the interface.

Please help!!
Question by:scott-GSS
    LVL 49

    Expert Comment

    Tray Apps "wake up" when they get clicked.  The Shell sends a WM_LBUTTONDOWN message to the window that is monitoring for it.
    The way to find out how to handle this is:
    Use Spy++ to find the Window that is associated with the tray app.
    Monitor the mesages it receives and sends as the user clicks the tray icon.
    Odds are, it posts a private message to itself or another window in the application... probably it unhides itself (WM_SHOWWINDOW and/or WM_ACTIVATEAPP) .  
    Just see what the program does to activate itself, then you do the same thing.

    Author Comment


    Correct me if I am wrong but Spy++ is a .Net application, not a VB Scripting tool...  I am not sure how to proceed with it.  You wouldn't happen to have samples of VB Scripts that can do what I am looking to do?
    LVL 49

    Accepted Solution

    No, I don't have a VBScript that does this, in fact, I failed to notice that you will be using VBScript.  Sorry.  The kinds of things that SP++ does is reveal hidden windows, and monitor window messages.
    You still might be able to useSpy++:  
    If you know the name of the window (actually the text in its caption) then you should be able to use   AppActivate to wake it up.  Spy++ will also reveal any other related windows that might be parent or child windows that will take action on an AppActivate call.
    Finally, the WShell object might not have a method that will work to do what you need.  You might need to write or find an AxtiveX object that does the needed low-level stuff.
    One outside-the-box idea:  
    Assign a hotkey for it (via a shortcut to the program), then use SendKeys to send that hotkey to the desktop.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
    zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    This video discusses moving either the default database or any database to a new volume.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now