スクロールさせたいだけなのに、いちいち座標の計算みたいなことをするのは面倒だ。こういった場合はメッセージを飛ばした方が楽。
Declare Auto Function SendMessage Lib "User32" _ (ByVal hWnd As IntPtr, ByVal uMsg As UInt32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32 Const WM_VSCROLL As UInt32 = &H115 ' 縦スクロール Const WM_HSCROLL As UInt32 = &H114 ' 横スクロール Const SB_LINEUP As UInt32 = 0 ' ↑ Const SB_LINEDOWN As UInt32 = 1 ' ↓ Const SB_PAGEUP As UInt32 = 2 ' PageUp Const SB_PAGEDOWN As UInt32 = 3 ' PageDown Const SB_THUMBPOSITION As UInt32 = 4 ' 絶対位置 Const SB_THUMTRACK As UInt32 = 5 ' ドラッグ Const SB_TOP As UInt32 = 6 ' HOME Const SB_BOTTMOM As UInt32 = 7 ' END Const SB_ENDSCROLL As UInt32 = 8 ' スクロール終了
' 例:ハンドルを指定して縦スクロールの PageUp を飛ばす SendMessage(***.Handle, WM_VSCROLL, SB_PAGEUP, 0)SendMessage
0 Comments :
Post a Comment