AutoIt basic concepts Tutorial Part 7 Important Functions WinActivate WinMove
YOUR LINK HERE:
http://youtube.com/watch?v=1FcuOQ8D_pc
In this tutorial session, we will learn about the following important methods: WinActivate(), WinMove() • • 1) WinActivate() and WinMove() • WinActivate() - This method will restore your minimized target window. • WinMove() - to move or resize target window • • Method Signature - WinMove ( title , text , x, y [, width [, height [, speed]]] ) • • title The title/hWnd/class of the window to move/resize. See Title special definition. • text The text of the window to move/resize. • x X coordinate to move to. • y Y coordinate to move to. • width [optional] New width of the window. • height [optional] New height of the window. • speed [optional] the speed to move the windows in the range 1 (fastest) to 100 (slowest). If not defined the move is instantaneous. • • First we need to read the class of the target window. Let's do it by using the Window Info Tool. • • Activity 1 - Let's open the window info tool. • Activity 2 - Now we will see the working of winActivate() method. • • Example script: • Example() • Func Example() • • ; Wait 10 seconds for the Notepad window to appear. • $hWnd = WinWait( [CLASS:Notepad] , , 10) • ; Wait for 5 seconds to display the Notepad window. • Sleep(5000) • • WinActivate($hWnd) • EndFunc • • Activity 3: Now we will move or resize target window with winMove() method. • • Example() • Func Example() • • ; Wait 10 seconds for the Notepad window to appear. • $hWnd = WinWait( [CLASS:Notepad] , , 10) • ; Wait for 5 seconds to display the Notepad window. • Sleep(5000) • • WinActivate($hWnd) • WinMove( [CLASS:Notepad] , , 200, 300, 900, 700, 100) • Sleep(5000) • ; Close the Notepad window using the class name of Notepad. • WinClose( [CLASS:Notepad] ) • EndFunc • #AutoItFunctionsTutorial #coolithelp
#############################
