zaqimon 發表於 17-2-9 21:49

快速鍵控制AmiBroker一次移動一根bar

AmiBroker可以透過左右鍵移動selection bar的方式一次移動一根bar
也可以透過滑鼠操作scrollbar的方式一次移動一根bar
但我一直沒找到如何用快速鍵方式讓AmiBroker一次移動一根bar

下面是透過AutoIt HotKeySet的方式自己定義快速鍵一次移動一根bar
Func AB_Scroll($left = False) ; default scroll right
        $hwnd = WinActive("") ; if AcmiBroker active
        If $hwnd = 0 Then Return ; return if not AmiBroker
        $hwnd = ControlGetHandle($hwnd, "", "") ; MDIClient child
        $hwnd = _WinAPI_GetWindow($hwnd, $GW_CHILD) ; 1st child
        $hwnd = _WinAPI_GetWindow($hwnd, $GW_CHILD) ; 1st child
        $hwnd_sb = ControlGetHandle($hwnd, "", "") ; 1st ScrollBar child
        If $left Then
                _SendMessage($hwnd, $WM_HSCROLL, $SB_LINELEFT, $hwnd_sb)
        Else
                _SendMessage($hwnd, $WM_HSCROLL, $SB_LINERIGHT, $hwnd_sb)
        EndIf
EndFunc

kingwang 發表於 17-8-11 14:11

感謝版主的分享,謝謝{:4_113:}
頁: [1]
查看完整版本: 快速鍵控制AmiBroker一次移動一根bar