;=================================================================================================
; Function: _PostMessage_ClickDrag($hWnd, $X1, $Y1, $X2, $Y2, $Button = "left")
; Description: Sends a mouse click and drag command to a specified window.
; Parameter(s): $hWnd - The handle or the title of the window.
; $X1, $Y1 - The x/y position to start the drag operation from.
; $X2, $Y2 - The x/y position to end the drag operation at.
; $Button - (optional) The button to click, "left", "right", "middle". Default is the left button.
; $Delay - (optional) Delay in milliseconds. Default is 50.
; Requirement(s): A window handle/title.
; Return Value(s): On Success - Returns true
; On Failure - Returns false
; @Error - 0 = No error.
; 1 = Invalid window handle or title.
; 2 = Invalid start position.
; 3 = Invalid end position.
; 4 = Failed to open the dll.
; 5 = Failed to send a MouseDown command.
; 5 = Failed to send a MouseMove command.
; 7 = Failed to send a MouseUp command.
; Author(s): KillerDeluxe
;=================================================================================================
Func _PostMessage_ClickDrag($hWnd, $X1, $Y1, $X2, $Y2, $Button = "left", $Delay = 50)
If Not IsHWnd($hWnd) And $hWnd <> "" Then
$hWnd = WinGetHandle($hWnd)
EndIf
If Not IsHWnd($hWnd) Then
Return SetError(1, "", False)
EndIf
If Not IsInt($X1) Or Not IsInt($Y1) Then
Return SetError(2, "", False)
EndIf
If Not IsInt($X2) Or Not IsInt($Y2) Then
Return SetError(3, "", False)
EndIf
If StringLower($Button) == "left" Then
$Button = $WM_LBUTTONDOWN
$Pressed = 1
ElseIf StringLower($Button) == "right" Then
$Button = $WM_RBUTTONDOWN
$Pressed = 2
ElseIf StringLower($Button) == "middle" Then
$Button = $WM_MBUTTONDOWN
$Pressed = 10
If $Delay == 10 Then $Delay = 100
EndIf
$User32 = DllOpen("User32.dll")
If @error Then Return SetError(4, "", False)
DllCall($User32, "bool", "PostMessage", "hwnd", $hWnd, "int", $Button, "int", "0", "long", _MakeLong($X1, $Y1))
If @error Then Return SetError(5, "", False)
Sleep($Delay / 2)
DllCall($User32, "bool", "PostMessage", "hwnd", $hWnd, "int", $WM_MOUSEMOVE, "int", $Pressed, "long", _MakeLong($X2, $Y2))
If @error Then Return SetError(6, "", False)
Sleep($Delay / 2)
DllCall($User32, "bool", "PostMessage", "hwnd", $hWnd, "int", $Button + 1, "int", "0", "long", _MakeLong($X2, $Y2))
If @error Then Return SetError(7, "", False)
DllClose($User32)
Return SetError(0, 0, True)
EndFunc
;=================================================================================================
; Function: _PostMessage_ClickDrag($hWnd, $X1, $Y1, $X2, $Y2, $Button = "left")
; Description: Sends a mouse click and drag command to a specified window.
; Parameter(s): $hWnd - The handle or the title of the window.
; $X1, $Y1 - The x/y position to start the drag operation from.
; $X2, $Y2 - The x/y position to end the drag operation at.
; $Button - (optional) The button to click, "left", "right", "middle". Default is the left button.
; $Delay - (optional) Delay in milliseconds. Default is 50.
; Requirement(s): A window handle/title.
; Return Value(s): On Success - Returns true
; On Failure - Returns false
; @Error - 0 = No error.
; 1 = Invalid window handle or title.
; 2 = Invalid start position.
; 3 = Invalid end position.
; 4 = Failed to open the dll.
; 5 = Failed to send a MouseDown command.
; 5 = Failed to send a MouseMove command.
; 7 = Failed to send a MouseUp command.
; Author(s): KillerDeluxe
;=================================================================================================
Func _PostMessage_ClickDrag($hWnd, $X1, $Y1, $X2, $Y2, $Button = "left", $Delay = 50)
If Not IsHWnd($hWnd) And $hWnd <> "" Then
$hWnd = WinGetHandle($hWnd)
EndIf
If Not IsHWnd($hWnd) Then
Return SetError(1, "", False)
EndIf
If Not IsInt($X1) Or Not IsInt($Y1) Then
Return SetError(2, "", False)
EndIf
If Not IsInt($X2) Or Not IsInt($Y2) Then
Return SetError(3, "", False)
EndIf
If StringLower($Button) == "left" Then
$Button = $WM_LBUTTONDOWN
$Pressed = 1
ElseIf StringLower($Button) == "right" Then
$Button = $WM_RBUTTONDOWN
$Pressed = 2
ElseIf StringLower($Button) == "middle" Then
$Button = $WM_MBUTTONDOWN
$Pressed = 10
If $Delay == 10 Then $Delay = 100
EndIf
$User32 = DllOpen("User32.dll")
If @error Then Return SetError(4, "", False)
DllCall($User32, "bool", "PostMessage", "hwnd", $hWnd, "int", $Button, "int", "0", "long", _MakeLong($X1, $Y1))
If @error Then Return SetError(5, "", False)
Sleep($Delay / 2)
DllCall($User32, "bool", "PostMessage", "hwnd", $hWnd, "int", $WM_MOUSEMOVE, "int", $Pressed, "long", _MakeLong($X2, $Y2))
If @error Then Return SetError(6, "", False)
Sleep($Delay / 2)
DllCall($User32, "bool", "PostMessage", "hwnd", $hWnd, "int", $Button + 1, "int", "0", "long", _MakeLong($X2, $Y2))
If @error Then Return SetError(7, "", False)
DllClose($User32)
Return SetError(0, 0, True)
EndFunc
owh thanks kdeluxe....for func makelong its same with mine or not?....
and for func mouse move...do u know the script?....i wanna make script like move cursor in game if that cursor like sword cursor it will mouseclick left(attack)...
EDIT und Drag and Drop 04/11/2010 - AutoIt - 3 Replies Hi, ich wollte fragen wie man einen GuiCtrlCreateEdit so macht, dass man eine Datei reinziehen kann und er dann im Edit den Namen der Datei zeigt.
Ich hab bei den Styles und EXStyles geguckt, aber nix gefunden.
D3D Menu -> Drag 02/13/2010 - General Coding - 0 Replies Moin.
Welche Möglichkeiten gibt es ein D3D Menu per Drag & Drop zu bewegen?
Mit Mouseover hab ich's probiert, da gibt's iwie Probleme mit den Koordinaten wegen der Fenstertitelleiste (War mit GetCursorPos & ScreenToClient).
Für die Sache mit dem Windowhook
mywndProc_Old = (WNDPROC)SetWindowLongPtr( hWnd, GWL_WNDPROC, (LONG)(LONG_PTR)newWndProc );
Bin ich anscheinend auch zu dumm :rolleyes:
[Help] Mob Drag Limit 11/15/2009 - Dekaron Private Server - 2 Replies Does anyone know where to set this? ive looked in maplist and monster.csv and I don't see anything that catches my eye on where to set it.
drag more than 3 mob 01/01/2008 - Dekaron - 15 Replies do anyone know how u can drag more than 3 monster at a time..