关于卷滚条消息(10分)

  • 主题发起人 主题发起人 TheCodec
  • 开始时间 开始时间
T

TheCodec

Unregistered / Unconfirmed
GUEST, unregistred user!
&nbsp; 我想给另外的窗口里面的卷滚条发滚动消息,但是我看到MSDN里面是这么写的:<br>The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control. <br><br>A window receives this message through its WindowProc function. <br><br>LRESULT CALLBACK WindowProc(<br>&nbsp; HWND hwnd, &nbsp; &nbsp; &nbsp; // handle to window<br>&nbsp; UINT uMsg, &nbsp; &nbsp; &nbsp; // WM_VSCROLL<br>&nbsp; WPARAM wParam, &nbsp; // request and position<br>&nbsp; LPARAM lParam &nbsp; &nbsp;// handle to scroll bar (HWND)<br>);<br>Parameters<br>wParam <br>The low-order word specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values. Value Meaning <br>SB_BOTTOM Scrolls to the lower right. <br>SB_ENDSCROLL Ends scroll. <br>SB_LINEDOWN Scrolls one line down. <br>SB_LINEUP Scrolls one line up. <br>SB_PAGEDOWN Scrolls one page down. <br>SB_PAGEUP Scrolls one page up. <br>SB_THUMBPOSITION The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation. <br>SB_THUMBTRACK The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to. <br>SB_TOP Scrolls to the upper left. <br><br><br>The high-order word specifies the current position of the scroll box if the low-order word is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this word is not used. <br><br>lParam <br>If the message is sent by a scroll bar, this parameter is the handle to the scroll bar control. If the message is not sent by a scroll bar, this parameter is NULL. <br>Return Values<br>If an application processes this message, it should return zero. <br><br>Remarks<br>The SB_THUMBTRACK request code is typically used by applications that provide feedback as the user drags the scroll box. <br><br>If an application scrolls the content of the window, it must also reset the position of the scroll box by using the SetScrollPos function. <br><br>Note that the WM_VSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_VSCROLL (and WM_HSCROLL) for scroll position data have a practical maximum position value of 65,535. <br><br>However, because the SetScrollInfo, SetScrollPos, SetScrollRange, GetScrollInfo, GetScrollPos, and GetScrollRange functions support 32-bit scroll bar position data, there is a way to circumvent the 16-bit barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollInfo for a description of the technique. <br><br>参数里面的lParam是handle to scroll bar (HWND),请问怎么才能得到其他窗口的handle好让我来向他发消息呢?<br>谢谢
 
用windowfrompoint获取指定坐标的window句柄。
 
:(<br>记住是别人的窗口也,我怎么处理坐标嘛?<br>我想试试FindWindow
 
FindWindow(nil,'别人的窗口');
 
pcexplorer兄玩笑了,呵呵
 
不知道能不能用 SetWindowLong() 来修改 WindowProc() 入口,<br>然后自已 Write 一个 WindowProc() 来处理 WM_VSCROLL message!
 
pcexplorer说得很对呀!
 
delphizhao兄,我说是别人的窗口,并不是说那个窗口名字就叫"别人的窗口",你好可爱,呵呵<br>varphone兄.可以修改其他应用程序的WindowProc么?
 
我知道FindWindow的参数,谢谢
 
兄弟:<br>可能是你的分太少了
 
:(,总共只有那么点点分,又不自动加参与分,我的分分已经用完啦,又回答不了别人的问题来赚分<br>看样子大富翁真的是只有高手来能来了,可是,我觉得吧,高手也不是生下来就是高手的吧?总是<br>从菜鸟一步一步学上来的,大家都这么做,高手只会越来越少,怎么提高我国的Delphi程序员水平呢?
 
后退
顶部