relight Posted April 25, 2007 Share Posted April 25, 2007 sorry for reviving this post, but has anyone got this working? I need badly a mouse click function that works even if the program is not in focus, but this baby doesn't seem to be working for me, heck it doesn't even work in MSpaint or notepad..... did I do something wrong or does it not work for V3? Link to comment Share on other sites More sharing options...
Zephir Posted July 21, 2007 Share Posted July 21, 2007 holy crap u are my hero Link to comment Share on other sites More sharing options...
Xgs Posted July 31, 2007 Share Posted July 31, 2007 Thank you for the code, took me awhile to get it workingDllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong(Number($X), Number($Y)))_MakeLong(Number($X), Number($Y))Cuz it might mistaken it as a string >.> Link to comment Share on other sites More sharing options...
sandman Posted August 2, 2007 Share Posted August 2, 2007 I'm trying to make an application launcher and I am looking for something like this. I found that instead of using WM_BUTTONDOWN, I should use WM_KEYPRESS. But I don't know what to put for the next parameter. Do I just put in the key, like "Y"? Or should it be in an ASCII code? [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
_Kurt Posted August 5, 2007 Share Posted August 5, 2007 It still does not work for me, even with the Number(). Can anyone show me a working example of this (tested on Notepad or something)? Thanks, Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
_Kurt Posted August 5, 2007 Share Posted August 5, 2007 Why doesn't this work..? expandcollapse popupOpt("MouseCoordMode", 0) HotKeySet("{F1}", "go") GUICreate("test") $button = GUICtrlCreateButton("",-5,-5,500,500) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $button MsgBox(0,"","Yes") EndSelect WEnd Func go() _MouseClickPlus("test", "left", 50, 50) ;should click the button.. EndFunc Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1) Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x020 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X = "" OR $Y = "" Then $MouseCoord = MouseGetPos() $X = $MouseCoord[0] $Y = $MouseCoord[1] EndIf For $i = 1 to $Clicks DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong(Number($X), Number($Y))) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong(Number($X), Number($Y))) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong(Number($X), Number($Y))) Next EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc This is a perfect test to see if it actually does infact work.. However it does not. Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
WolfWorld Posted August 6, 2007 Share Posted August 6, 2007 Does Not Work In Vista Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
rejectpenguin Posted August 17, 2007 Share Posted August 17, 2007 Ive been testing this in paint and I cant get it to work anymore.. I used to be able to use it about a month ago with the exact same script? Is there an update or some way I can get it to work like going back to an older version of autoit? Link to comment Share on other sites More sharing options...
faldo Posted September 14, 2007 Share Posted September 14, 2007 I just wanted to add that i tried this with Eve Online and Vanguard and i managed to get it to work while windows were minimized. Thanx for a great UDF. Check out my other scripts: RDP antihammer/blacklist generator | Phemex cryptocurrency exchange API Link to comment Share on other sites More sharing options...
Yho2005 Posted November 17, 2007 Share Posted November 17, 2007 Hello, I know this has been redug lots of times but if someone can prove this works on MSPaint for example then it would be incredibly helpful and the post can be stickied. I can imagine that lots of people are interested in this but are struggling to make it work. In terms of the code I'm wondering if it's the user32.dll that's causing problems. I've tried using Filemon (third party program) to see if AutoIT accesses the file when running the script but it doesn't seem to be working. I created a loop continually running _MouseClickPlus but AutoIT only accesses user32.dll once despite my script being in a loop constantly running _MouseClickPlus. Link to comment Share on other sites More sharing options...
Aperol Posted December 9, 2007 Share Posted December 9, 2007 i need help with this code, i need to write a script for diablo2, i run diablo2 windowed with d2loader i need the code for click the enter chat button and after click on the channel button, all this when d2 windowed is minimized can u help me please? Link to comment Share on other sites More sharing options...
bf2forlife Posted July 31, 2008 Share Posted July 31, 2008 sorry for bumping this old post, but does this actually move the mouse and then click or does it just instantly in given coordinates? Link to comment Share on other sites More sharing options...
ALERT Posted September 22, 2008 Share Posted September 22, 2008 Simple MouseDragPlus upgrade to first post: CODEFunc _MouseDragPlus($Window, $Button = "left", $X1 = "", $Y1 = "", $X2 = "", $Y2 = "") Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X1 = "" OR $Y1 = "" OR $X2 = "" OR $Y2 = "" Then $MouseCoord = MouseGetPos() $X1 = $MouseCoord[0] $Y1 = $MouseCoord[1] $X2 = $MouseCoord[0] $Y2 = $MouseCoord[1] EndIf DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X2, $Y2)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong($X2, $Y2)) EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc Link to comment Share on other sites More sharing options...
yehia Posted January 3, 2009 Share Posted January 3, 2009 anyway to make this work again? My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
Kragen Posted January 20, 2009 Share Posted January 20, 2009 anyway to make this work again?I'm going to have a look at this tonight.I'll let you know what I end up with. First off, I'll make it work with MS Paint, after that Diablo II, and if I can, World of Warcraft or something else. Link to comment Share on other sites More sharing options...
tangokilla Posted January 29, 2009 Share Posted January 29, 2009 I'm going to have a look at this tonight.I'll let you know what I end up with. First off, I'll make it work with MS Paint, after that Diablo II, and if I can, World of Warcraft or something else.Thanks for the work! Let us know how it goes. Link to comment Share on other sites More sharing options...
Coins Posted April 26, 2009 Share Posted April 26, 2009 Anyone got this working? Link to comment Share on other sites More sharing options...
zutto Posted April 26, 2009 Share Posted April 26, 2009 Anyone got this working?theres nothing wrong with it? Link to comment Share on other sites More sharing options...
strikeout Posted July 13, 2009 Share Posted July 13, 2009 (edited) thanks! works like a charm! Edited July 13, 2009 by strikeout Link to comment Share on other sites More sharing options...
binhepu Posted October 15, 2009 Share Posted October 15, 2009 Alright then. From looking at this topic it doesn't look like a lot of people have had successes with this so I'm posting an example of what I think the script should look like. The best way of showing if the script has worked or not would be to test the script in MS Paint. That way if the click works then there's a large area of Paint where the effect can be seen. First you click on Paint's Fill button then run the script. Theoretically the script should click a certain part of the screen and then fill it in a different colour from that of the original (typically white). The script below doesn't work but I'm interested in why it doesn't and I'm sure that if an answer can be found to make it work, it'd make it easier for other people to solve their own minimised windows click scripts. expandcollapse popupOpt("MouseCoordMode", 0) $winsize = WinGetPos("untitled - Paint") $borderwidth = ($winsize[2] - 1024) / 2 $titleheight = $winsize[3] - 768 - (2 * $borderwidth) _MouseClickPlus("untitled - Paint","left",500-$borderwidth,200-$TitleHeight) ;=============================================================================== ; ; Function Name: _MouseClickPlus() ; Version added: 0.1 ; Description: Sends a click to window, not entirely accurate, but works ; minimized. ; Parameter(s): $Window = Title of the window to send click to ; $Button = "left" or "right" mouse button ; $X = X coordinate ; $Y = Y coordinate ; $Clicks = Number of clicks to send ; Remarks: You MUST be in "MouseCoordMode" 0 to use this without bugs. ; Author(s): Insolence <insolence_9@yahoo.com> ; ;=============================================================================== Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1) Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X = "" OR $Y = "" Then $MouseCoord = MouseGetPos() $X = $MouseCoord[0] $Y = $MouseCoord[1] EndIf For $i = 1 to $Clicks DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong($X, $Y)) Next EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc Me too, who can help for an example for this function Link to comment Share on other sites More sharing options...
Recommended Posts