Sign in to follow this  
Followers 0
donhorn20

Status/progress bar to display until an exe is present in the Task Tray.

2 posts in this topic

I have been searching the forums for some samples and came across the following script by member UEZ <> which provided a scrolling marquee. I can get it to function until the process is launched, but I need it to stay open until the it appears in the tray (hidden or shown). This is where I am running into some problems.

Here are my scenarios of how I need it to run.

- If no process (Agent.exe) is running after 5 seconds then stop marquee
- If process (Agent.exe) and tray (Systems Agent) are present then stop marquee
- If process (Agent.exe) is running but no tray (Systems Agent) then continue marquee until tray (Systems Agent) appears.

Here is the code I have so far. It runs until the process is detected then exits. But I need it to stay open until the tray icon appears as well. This way the user knows it has been launched but is just running in the background. Any help on this would be greatly appriciated. You can test on your own station by swapping out the "Agent.exe" with any of your local exe applications running.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$dir = False

GUICreate("Marquee Progress RTL", 400, 200)
$Progress = GUICtrlCreateProgress(10, 60, 380, 25, 0x08, 0x2000)
GUICtrlSendMsg($Progress, 0x040A, 1, 10)
GUISetState()
AdlibRegister("Reverse_Dir", 1350)

Do
;~ Until GUIGetMsg() = $GUI_EVENT_CLOSE

Until   ProcessExists("Agent.exe")
    Local $PID = ProcessExists("Agent.exe") ; Will return the PID or 0 if the process isn't found.
    If $PID Then ProcessExists($PID)
Exit

Func Reverse_Dir()
    If $dir Then
        GUICtrlSetStyle($Progress, 0x08, 0x2000)
        $dir = False
    Else
        GUICtrlSetStyle($Progress, 0x08, $WS_EX_LAYOUTRTL)
        $dir = True
    EndIf
EndFunc

I ran the information tool to see what it returns for this exe in the tray menu and here is what I get, just in case someone is wondering.
>>>> Window <<<<
Title: 
Class: Shell_TrayWnd
Position: 0, 984
Size: 1280, 40
Style: 0x96000000
ExStyle: 0x00000088
Handle: 0x0000000000010084

>>>> Control <<<<
Class: ToolbarWindow32
Instance: 1
ClassnameNN: ToolbarWindow321
Name: 
Advanced (Class): [CLASS:ToolbarWindow32; INSTANCE:1]
ID: 1504
Text: User Promoted Notification Area
Position: 1093, 2
Size: 102, 38
ControlClick Coords: 11, 24
Style: 0x56008B4D
ExStyle: 0x00000080
Handle: 0x00000000000100A4

>>>> ToolsBar <<<<
1: 3 Systems Agent

Share this post


Link to post
Share on other sites



Hi,

You will need a main loop, the ProcessExists, TimerInit/TimerDiff, Systray_GetIconIndex (link in my signature) functions.

Try to build something and come back :)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0