Sign in to follow this  
Followers 0
Daniza

Little help for Mouse and form

5 posts in this topic

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.

 

Share this post


Link to post
Share on other sites



Is there a question in there somewhere?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Sorry, i cant not run the script right now, so i want to check if the script runs fine, thanks.

Share this post


Link to post
Share on other sites

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.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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
1 person likes this

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
Sign in to follow this  
Followers 0