Mouse Posted February 27, 2013 Posted February 27, 2013 Can someone help me with this? I'm trying to (set) the mouse position with $Haha = DllCall("user32.dll "," bool "," SetCursorPos "," int ",997," int ", 435) and when i run that, there is no errors... but it doesn't set my mouse to that position Here is my script... when i press the middle mouse button it is suppose to run $Haha but again - it doesnt #Include #include #include Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("04", $hDLL) Then lol() ; Now wait until the key is released While _IsPressed("04", $hDLL) Sleep(10) ; ; You need this to keep the CPU from overheating when in this inner loop WEnd EndIf Sleep(10) ; You also need this to keep the CPU from overheating when in this outer loop WEnd Func lol() ;;;;;;;;;;; $hDLL = DllOpen("user32.dll") ;;;;;;;;;;;;;;;;;;;;;;;; DllCall("user32.dll "," bool "," SetCursorPos "," int ",997," int ", 435) endfunc
Moderators Melba23 Posted February 27, 2013 Moderators Posted February 27, 2013 Mouse,And why are you not using MouseMove? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Mouse Posted February 27, 2013 Author Posted February 27, 2013 (edited) Mouse,And why are you not using MouseMove? M23Tryin' something differentI have been using Autoit for about 2 years now, and i have always been using Mousemove...so i want to see if i can approach this a different way by using this method and actually setting the mouse position; thats all. Edited February 27, 2013 by Mouse
PhoenixXL Posted February 27, 2013 Posted February 27, 2013 (edited) This doesDllCall("user32.dll ","bool","SetCursorPos","int",997,"int", 435) Why to add unnecessary spaces please do check the error macro you are definitely gonna get an error Regards Edited February 27, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
conkel Posted February 27, 2013 Posted February 27, 2013 I think I have the same problem too... I want to write a number in a small box-window but it doesnt do it, what it does: It writes the number at the same place where my mouse is - which is wrong. I am telling to go to the box-window in this case:ClassnameNN:TEdit16 I am using following command lines: ControlClick("[ClassnameNN:TEdit16]", "", "") Send($wert[1]) Could somebody help me, Thanks
LarryDalooza Posted February 27, 2013 Posted February 27, 2013 try ControlFocus() AutoIt has helped make me wealthy
conkel Posted February 28, 2013 Posted February 28, 2013 I used ControlFocus()but I still have the same problem....the curser goes to the last place I clicked before I startet my program.I used follwing code:WinActivate("[CLASS:TVMU]", "")WinWaitActive ("[CLASS:TVMU]", "")Controlfocus("[ClassnameNN:TEdit16]", "", "")send("1000")This is the information I get from Autoit v3 Window Info:>>>> Control <<<<Class: TEditInstance: 16ClassnameNN: TEdit16Name: Advanced (Class): [CLASS:TEdit; INSTANCE:16]ID: 3408674 //Not always the sameText: Position: 93, 301 //Always the sameSize: 60, 24 //Not always the sameControlClick Coords: 10, 10Style: 0x540000C0 // Not always the sameExStyle: 0x00000200 // Not always the sameHandle: 0x00340322
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now