views:

29

answers:

2

We're "automating" a third part application by writing a script to mimick using input. We're able to mouse click, send keystrokes etc by using win32 calls, but I'm having trouble automating manipulating a scroll bar.

I've found the window who's location matches the visual location of the scrollbar, so I'm pretty sure I have the window handle. Unfortunately the GetScrollInfo method just returns zeros for the scrollbar position, min,max, page size etc, and the SetScrollInfo doesn't appear to update the scrollbar, although both calls to SetScrollInfo and SetScrollInfo do return success... Is there something I'm missing here?

A: 

try sending page up, page down, or arrow key keystrokes

Beth
+2  A: 

Since you're able to get the scroll bar window handle, I would try using SendMessage with WM_VSCROLL (or WM_HSCROLL). I think those built-in functions are designed to work within ones own process, whereas SendMessage will work with external processes, as well as your own.

http://msdn.microsoft.com/en-us/library/bb787577%28VS.85%29.aspx

Joe