Jump to content

WinActive don't work after logoff RDP ?


Recommended Posts

(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
    $x = $x+ 1

Func Test()

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

    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)

Edited by pocolo
Link to comment
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.

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...