Jump to content

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


aa2zz6
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

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