aa2zz6

ControlMove won't function at all. (Used a different method)

9 posts in this topic

#1 ·  Posted (edited)

In my script I created a parent child GUI. I set the $X and $Y coordinates as random variables and I included the ControlMove for the mouse to follow the Child GUI. I can't seem to get the ControlMove to move in the direction of the Child GUI.

 

#include <WindowsConstants.au3>
#include <IE.au3>

HotKeySet("{ESC}", "Terminate")

;;==============================================================================;;
;;===============================GUI DESIGN======================================;;
;;==============================================================================;;
;;==============================================================================;;

$width = 800
$height = 625

$hMain = GUICreate("COK", 1015, 585, @DesktopWidth / 2 - $width / 2, @DesktopHeight / 2 - $height / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$wPos = WinGetPos($hMain)
GUISetState(@SW_SHOW,$hMain)

$x = Random( 0, 500)
$y = Random( 0, 500)

$Child_GUI = GUICreate("Child", 100, 100, $x, $y, $WS_POPUP,BitOR($WS_EX_MDICHILD,$WS_EX_TRANSPARENT),$hMain)
WinSetTrans($Child_GUI, "", 200)
GUISetBkColor(0xfffaf0, $Child_GUI)
GUISetState(@SW_SHOW, $Child_GUI)

$WinLoc = WinGetPos($Child_GUI)
MouseMove($WinLoc[0]+($WinLoc[2]/2),$WinLoc[1]+($WinLoc[3]/2),20)

;;==============================================================================;;
;;===============END==============GUI DESIGN====================================;;
;;==============================================================================;;
;;==============================================================================;;

While 1
sleep(1000)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

 

Edited by aa2zz6

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Wait a tick...why are you passing in the window handle to be moved as a control...do you really just want to WinMove?

Other than that, I suggest you click the links in your post (the blue functions), and read what the function does, and what params to pass into it.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

The AutoIt v3 Window Info doesn't display any information of the child GUI so I was trying anything at this point. Everything works fine if I remove the control function out of the script beside the cursor not moving onto the child GUI. I tried the MouseMove but the cursor wouldn't move to the location. I'll revise this project after a good nights sleep.

Share this post


Link to post
Share on other sites

To move the Child-GUI you have to use WinMove.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I solved my problem. I'll edit the code in the first post.

Edited by aa2zz6

Share this post


Link to post
Share on other sites

I can appreciate the help on the AutoIt forums. Feel free to delete this thread. The controlmove function probably wouldn't of worked.  

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