FindWindow
SendMessage
SendMessage
FindWindow
SendMessage
这样try.
SendMessage
这样try.
用SendMessage给窗口发WM_HSCROLLMessage,不过窗口不一定响应,要看program是怎么设计的.
我发送过WM_HSCROLL,没有效果,但是很奇怪,罗技等厂商的5键鼠标,在XP下装了它的驱动后,用中间键左右摇摆就可以可以控制很多有滑动窗口的program的水平滚动
哦,后来发现WM_HSCROLL可以,不过要先取得那个 Control 的窗口,结束
POINT pMouse;
GetCursorPos(&pMouse);
CWnd* pWnd = CWnd::WindowFromPoint(pMouse);
HWND hwndCurr = pWnd->GetSafeHwnd();
if(hwndCurr != NULL)
{
::SendMessage(hwndCurr,WM_HSCROLL,SB_LINELEFT, 0 );
POINT pMouse;
GetCursorPos(&pMouse);
CWnd* pWnd = CWnd::WindowFromPoint(pMouse);
HWND hwndCurr = pWnd->GetSafeHwnd();
if(hwndCurr != NULL)
{
::SendMessage(hwndCurr,WM_HSCROLL,SB_LINELEFT, 0 );
}
本文转自博客园知识天地的博客,原文链接:控制 滚动条,如需转载请自行联系原博主。