Jump to content

Recommended Posts

Posted

Hi, how do i store the 4 elemant array from the WinGetPos() function thats called inside an array, into another array?

Example:

Dim $array[3]
$array[2] = WinGetPos("window name")
If IsArray($array[2]) Then
Dim $offset[5]
;i want to store the arrays from $wpos[2] into the $offset array.
Endif

Here is my code:

#include <Array.au3>

#region = Attach Window
Dim $DaWindow[4], $process
Dim $window = 2
$DaWindow[3] = -1
While $DaWindow[3] < 0
    $DaWindow[$window + (2/2)] = InputBox("Select Window", "Enter Window Name", "")
WEnd
Dim $hWnd[$window]
$hWnd[1] = WinGetHandle($DaWindow[3])
Dim $process[$hWnd[1]]
$process[1] = "0x" & Hex(ubound($process), 8)
#endregion

#region = Main Loop
While ($process[1] = $hWnd[1]) Or $hWnd[1] > 0
    If ProcessExists($DaWindow[$window + (2/2)] & ".exe") > 0 Then
        Dim $wpos[$window + 1]
        $wpos[1] = WinGetTitle($hWnd[3 - $window])
        $wpos[2] = WinGetPos($hWnd[1])
        If StringInStr($wpos[1], "Eru") Then
            If IsArray($wpos[2]) Then
                Dim $offset[5]
            ;???????
            ;im stuck here
            ;???????
            EndIf
        Else
            msgbox("","","full window")
        EndIf
    Else
        If _Error("Window Closed") < 0 Then Exit
    EndIf       
    sleep(10)
WEnd
#endregion

#region = Functions
Func _Error($error, $title = "Error", $type = 16, $base = "Press ok to terminate.")
    Msgbox($type, $title, $error & @CRLF & $base)
    Return -1
EndFunc
#endregion

thanks

Posted

Try

Dim $array
$array = WinGetPos("window name")
If IsArray($array) Then
Dim $offset[5]
;i want to store the arrays from $wpos[2] into the $offset array.
$offset[1] = $array[2]
Endif

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...