Jump to content

Recommended Posts

Posted

Hello,

May I ask why the following works with MouseCoordMode "1", but NOT with MouseCoordMode "0"

; -----------------------------------------------
#include <AutoItConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 0)
; -----------------------------------------------
Global $iTimeOut = 100
; ---------------------
Global $hSAC_MAIN = "[CLASS:SAC_MAIN]"
Global $hSAC_FULLMIXER = "[CLASS:SAC_FULLMIXER]"
; -----------------------------------------------
RepositionSACTracks()
; -----------------------------------------------
Func RepositionSACTracks()
    ViewMenuSAC()
;~  RepositionO01SAC()
EndFunc   ;==>RepositionSACTracks
; -----------------------------------------------
Func ViewMenuSAC()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    ; Select: Full Mixer View
    WinMenuSelectItem($hSAC_MAIN, "", "&View", "&Full Mixer")
    ; -----------------
    ; Resize: Full Mixer View
    ; Select: Right edge of F Mixer
    ; Move: Right edge of F Mixer
    ControlClick($hSAC_FULLMIXER, "", "", "left", 1)
;~  Opt("MouseCoordMode", 1)
    MouseClickDrag($MOUSE_CLICK_LEFT, 1907, 800, 368, 424, 0)
EndFunc   ;==>ViewMenuSAC
; -----------------------------------------------

Notes
1) Lines 1-28 work as expected with MouseCoordMode "0"
2) However, line 30 requires line 29 to "work"!
3) The SAC Full Mixer view requires a MouseClickDrag function and NOT a MouseMove function

Any assistance|advice would be greatly appreciated!

Posted

Hello,

Obtained the following from a AI search:

; -----------------------------------------------
#include <AutoItConstants.au3>
#include <WinAPIConv.au3>
#include <SendMessage.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 0)
; -----------------------------------------------
Global $iTimeOut = 100
; ---------------------
Global $hSAC_MAIN = "[CLASS:SAC_MAIN]"
Global $hwnd = "[CLASS:SAC_FULLMIXER]"
Global $x1 = 1793
Global $y1 = 350
Global $x2 = 368
Global $y2 = 424
; -----------------------------------------------
ControlMouseDrag($hwnd, $x1, $y1, $x2, $y2)
; -----------------------------------------------
Func ControlMouseDrag($hwnd, $x1, $y1, $x2, $y2)
    WinActivate($hSAC_MAIN)
    WinActivate($hwnd)
    Local $WM_LBUTTONDOWN = 0x0201
    Local $WM_MOUSEMOVE = 0x0200
    Local $WM_LBUTTONUP = 0x0202
    ; Move to the starting position
    _SendMessage($hwnd, $WM_MOUSEMOVE, 0, _WinAPI_MakeLong($x1, $y1))
    ; Simulate mouse down
    _SendMessage($hwnd, $WM_LBUTTONDOWN, 1, _WinAPI_MakeLong($x1, $y1))
    ; Move to the end position
    _SendMessage($hwnd, $WM_MOUSEMOVE, 1, _WinAPI_MakeLong($x2, $y2))
    ; Simulate mouse up
    _SendMessage($hwnd, $WM_LBUTTONUP, 0, _WinAPI_MakeLong($x2, $y2))
EndFunc   ;==>ControlMouseDrag
; -----------------------------------------------

Have been unable to get the to work!!

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
×
×
  • Create New...