Hey guys, i'm sorry i'm not very active here... but i've been coding with autoit for a couple years but i cant get this to work.
I have tried all kinds of things but to no luck.
Its a script that doesn't really serve any purpose but for a test on my self but i have failed it.
Its suppose to work like this, you open up Paint (Mspaint)
and then you resize the drawing area to fit the box completetly (recommended)
then you can place something like Notepad overtop of the Mspaint window,
overtop of the drawing area and then wherever you click on the notepad screen
(thats in the drawing area overtop of ms paint)
it will grab the coords of your mouse when you click, and then use
those coords for a ControlClick on the mspaint window.
Basically allowing me to click on the window from anywhere, even if notepads not ontop (obviously) like my desktop.
It sends the controlclick to mspaint, but its y axis is always in the middle of the drawing part but the x axis works fine.
Please help me, i really want to see whats going on here.
#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <Constants.au3> #include <WinAPI.au3> #include <Misc.au3> #include <File.au3> #include <Misc.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("MsPaint Draw", 203, 61, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 0, 0, 201, 21) $Input2 = GUICtrlCreateInput("Input2", 0, 32, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;;;;;;;;;;;;;;;;;;;;;;;;; Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("01", $hDLL) Then getdat() ; Now wait until the key is released While _IsPressed("01", $hDLL) Sleep(1) WEnd EndIf Sleep(1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 WEnd func getdat() $pos = MouseGetPos() $Handle = WinGetHandle("Untitled - Paint") sleep(100) Controlclick($Handle,"","Afx:d0000:81","left",1, $pos[0] & "," & $pos[1]) endfunc