开发者

How to scroll the scrollbar in external application via WinAPI?

Description

I'm trying to test application coded in Delphi (VCL components by DevEx) with TestComplete. Application is built without debug info.

I need to scroll TcxTreeList component. The problem is when I set Position property for this component's scrollbars content is not scrolled but scroll bar position changes. I tried a lot of approaches and suppose that WinAPI can help me.

The Question:

How to scroll the scrollbar in external application via WinAPI?

I found PostMessage function, but I do not know how to synthesize WM_SCR开发者_JAVA技巧OLL message...


Scroll one line down (you can see other constants at the page JustBoo mentions);

PostMessage(HWnd, WM_VSCROLL, SB_LINEDOWN, 0)

Scroll to a specific position;

PostMessage(HWnd, WM_VSCROLL, MakeWParam(SB_THUMBPOSITION, 30), 0)


But if you refer to this page on the Devex forums, it is mentioned that "ScrollBar in the cxTreeList it is another control, not standard windows scrollbar". So it might not work. In this case you might want to try ScrollWindowEx coupled with setting the position as you already do.


These links should show how to setup the parameters to a PostMessage call for scrolling.

WM_HSCROLL Message

WM_VSCROLL Message

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜