Jump to content

Little help for Mouse and form


Recommended Posts

a simple script that if i hit button CTRL, the coordinates of recent mouse position and the values will be inserted on current position of the cursor.

forum help me search this so I try to play around with the codes.

$MousePos = MouseGetPos() , $MousePos[0] ; Mouse X position , $MousePos[1] ; Mouse Y position,

If...Then ,ControlSetText or Send, _IsPressed

so I get this, not sure if it will work because im on my work today, and company dont allowed to install 3rd party program, so basically im just drafting my script and work on my script if i got home.

Local $hDLL = DllOpen("user32.dll")
$MousePos = MouseGetPos() 
 
 Run("notepad.exe")

 Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
while 1

  If _IsPressed("11", $hDLL) Then
      
  ControlSetText($hWnd, "", "Edit1", "$MousePos[0], $MousePos[1]" )

        While _IsPressed("10", $hDLL)
            Sleep(250)
        WEnd

wend

Im still practicing and im not a real programmer just a hobby. Thanks.

 

Link to comment
Share on other sites

  • Moderators

This is not a "test it for me" forum, it is a forum for helping people with their scripts. If you don't know whether you even have a problem I would suggest waiting until you can test it yourself.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Please use code-tag's ( <> ) next time.

The script wouldn't run:

>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:C:\Users\Bert\AutoIt3.My\Temp\test3.au3
"C:\Users\Bert\AutoIt3.My\Temp\test3.au3"(22,1) : error: missing EndIf.
wend
^
"C:\Users\Bert\AutoIt3.My\Temp\test3.au3"(12,34) : REF: missing EndIf.
  If _IsPressed("11", $hDLL) Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Bert\AutoIt3.My\Temp\test3.au3"(12,28) : error: _IsPressed(): undefined function.
  If _IsPressed("11", $hDLL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Bert\AutoIt3.My\Temp\test3.au3 - 2 error(s), 0 warning(s)
!>15:04:07 AU3Check ended. Press F4 to jump to next error.rc:2
+>15:04:07 AutoIt3Wrapper Finished.

and after correcting the errors it will ignore mousemove and set allways the mousecoords from script begin.

Edited by AutoBert
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...