views:

44

answers:

1

Hello,

I need to create an application which do the following:

At the beginning we have notepad window open with a lot of text in it.

Our application must scroll through this file and take notepad window screenshot after each scroll action.

I've tried to achieve this using SBM_GETRANGE, SBM_GETRANGE, SBM_SETPOS but it does not work for me.

Please note that emulating keyboard events (e.g. PageDown, PageUp) is not an option for me because this application should also work with other applications which may not support keyboard shortcuts for manipulating scrolls.

Thanks.

+1  A: 

Don't try to manipulate the scrollbar directly - instead SetFocus() to the text window, then send Page Down messages. If there are applications where you must manipulate the scrollbar, you should get its window handle and send the messages there.

egrunin
As I have already said - emulating keyboard events is not a option. Or you mean some other "Page Down message"?I already have notepad window handle same as edit control handle and still can't manipulate scrollbars by sending scrollbar messages to them.
Alex
1. I should have remembered: Notepad is NOT a 'normal' windows application. The "scrollbar", for example, is not a normal scrollbar (it doesn't show up in Spy++).
egrunin
2. As I said, if the target application only accepts input to the scrollbar itself, send keystroke messages to the scrollbar.
egrunin
In all applications I've already analyzed scrollbar is not a separate control (if that's what you mean).
Alex