Jump to content
Sign in to follow this  
barribar

Script didnt work when windows is in toolbarwindow321

Recommended Posts

barribar

This script work fine whene the window is maximize, BUT didnt work when it is in tray icons

If NOT WinExists("Mobile Connect") Then; It s already running
    Run("C:\Program Files\Huawei technologies\Mobile Connect\Mobile Connect.exe")
    sleep (10000)
EndIf

while 1
    $var = WinList()
    For $i = 1 to $var[0][0]
        Switch $var[$i][0]  
        case "Mobile Connect"
            If WinExists("Mobile Connect","Network") AND WinExists("Mobile Connect","--") Then
                send("{F2}");Connect
            EndIf
        case "Prompt"
            If WinExists("Prompt") Then
                send("O");exit
                exit
            EndIf
        case "Error"
            If WinExists("Error","Une connexion à l'ordinateur") Then
                send("{ENTER}") 
            EndIf
        case "Dial Connection"
            If WinExists("Dial Connection","Failed to connect") Then
                send("{ENTER}") 
            EndIf
        EndSwitch
    Next
WEnd

Func IsVisible($handle)
    
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Any help PLZ

thanx

sorry for my bad language

Edited by barribar

Share this post


Link to post
Share on other sites
Drew

I'm not sure , but you said this works fine when its maximized so I think I'm right.

If your trying to run the program while the window "Mobile Connect","Network" is minimized , it won't work because commands like:

send("{F2}") ;Connect

and

send("O") ;exit

Send to the active window. You want those commands to be sent to the Mobile Connect.

That's why it's not working when it's minimized.

EDIT

To fix this:

Make use of commands like ControlSend

HelpFile :)

Edited by Drew

Share this post


Link to post
Share on other sites
barribar

I'm not sure , but you said this works fine when its maximized so I think I'm right.

If your trying to run the program while the window "Mobile Connect","Network" is minimized , it won't work because commands like:

send("{F2}") ;Connect

and

send("O") ;exit

Send to the active window. You want those commands to be sent to the Mobile Connect.

That's why it's not working when it's minimized.

EDIT

To fix this:

Make use of commands like ControlSend

HelpFile :)

tank u Drew but i think the probleme is here :

If WinExists("Mobile Connect","Network") AND WinExists("Mobile Connect","--") Then

when this window is maximize i can show The title of window(Mobile Connect) and the texte "Network" and "--", if the window is minimize i only show the tiltle

Share this post


Link to post
Share on other sites
Drew

Well If it's working thats all that matters. Nicely done, sorry I wasn't of much help.

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  

×