Sign in to follow this  
Followers 0
pocolo

WinActive don't work after logoff RDP ?

7 posts in this topic

#1 ·  Posted (edited)

(iam not good at EN)

I try write a small script , and put it on my VPS Windows

- If i login VPS -> it works:

- After logoff and try login again -> not work ( not control ? )

Pls help

Posted Image

.

.

.

.

Posted Image

$x = 0

While $x < 10
    Test()
    $x = $x+ 1
    Sleep(10000)
WEnd

Func Test()

    If ProcessExists("winrar.exe") Then ProcessClose("winrar.exe")
    $WinRarDir  = @ProgramFilesDir &"\WinRAR\WinRAR.exe"
    Run($WinRarDir)
    Sleep(2000)
    $title = "Compressed - WinRAR"
    ConsoleWrite("-Open Compressed WinRAR")
    WinWaitActive($title)
    WinActive($title)

    If WinActive($title) Then
        ControlFocus( $title, "", "[CLASS:SysListView32; INSTANCE:1]")
        $hwnd = ControlGetHandle( $title, "", "[CLASS:SysListView32; INSTANCE:1]")
        $index = _GUICtrlListView_FindText($hwnd,"zip")
        _GUICtrlListView_SetItemSelected($hwnd, $index)
        _GUICtrlListView_SetItemSelected($hwnd, $index)
        ;.......
        ;......
    EndIf

EndFunc
Edited by pocolo

Share this post


Link to post
Share on other sites



don't have solution?

Share this post


Link to post
Share on other sites

I'm sure I've seen methods you can try, they sometimes work and sometimes do not as I recall.

It was something like this.

$PID =Run($WinRarDir)

Get the window handle from PID, and get shut of if WinActive($handle)


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

I'm sure I've seen methods you can try, they sometimes work and sometimes do not as I recall.

It was something like this.

$PID =Run($WinRarDir)

Get the window handle from PID, and get shut of if WinActive($handle)

No control to work :graduated:

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