E1M1 8 Posted December 17, 2010 (edited) I cant find out why that code doesnt work on paint. It should draw dot there. It just dont click. I used it few months ago on other app, then it worked, but now paint is problematic. Any ideas? expandcollapse popupOpt("MouseCoordMode", 0) Opt("WinTitleMatchMode", 2) _MouseClickMinimized("untitled - Paint", "left", 500, 500) Func _MouseClickMinimized($window, $Button = "left", $X = "", $y = "", $Clicks = 1) ;~ ConsoleWrite("Window: "&$window&" Button "&$Button&" X "&$x&" y "&$y&@CRLF) 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 = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case Else Exit EndSelect If $X = "" Or $y = "" Then Exit 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 ;==>_MouseClickMinimized Func _MakeLong($LoWord, $HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc ;==>_MakeLong Edited December 18, 2010 by E1M1 edited Share this post Link to post Share on other sites