• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 685
  • Last Modified:

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

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!!
0
scott-GSS
Asked:
scott-GSS
  • 2
1 Solution
 
DanRollinsCommented:
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) .  
So...
Just see what the program does to activate itself, then you do the same thing.
0
 
scott-GSSAuthor Commented:
Dan,

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?
0
 
DanRollinsCommented:
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.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now