Jump to content

Winlist out of index


kantaki
 Share

Recommended Posts

hello,

i wrote a little autoit script in the past, which moves some windows.

but i have problem with implementing this in c sharp.

Func Refresh()
            $WinList = WinList("[CLASS:#32770]")
    EndFunc
    
    Func StartUp()
            Refresh()
                    For $i = 1 To $WinList[0][0]
                            WinMove($WinList[$i][0], "", 0, 0, 640, 463)
                    Next
    EndFunc

here my c sharp code

static void Main(string[] args)
        {
            AutoItX3 au3 = new AutoItX3();


            // finds 10 windows
            dynamic[,] winlist = au3.WinList("[CLASS:#32770]");
            
            Console.WriteLine(winlist[2,0]);
            
            Console.ReadKey();
            
        }

winlist[0,0] tells me it has found 10 windows but i can only access winlist[1,0] , until winlist[2,0] ill get an out of index exception.

what could be the problem ?

and how can i print the title ?

thanks

edit :

nvm i got it.

for future problems the array is swaped that means you iterate in c sharp with winlist[0,i]

Edited by kantaki
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
 Share

  • Recently Browsing   0 members

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