简体   繁体   English

在第三方应用程序中操纵滚动条

[英]Manipulating scrollbars in third-party application

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. 我尝试使用SBM_GETRANGE,SBM_GETRANGE,SBM_SETPOS实现此目的,但它对我不起作用。

Please note that emulating keyboard events (eg 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. 请注意,模拟键盘事件(例如PageDown,PageUp)对我来说不是一个选项,因为此应用程序还应与其他可能不支持操纵键盘快捷键的应用程序一起使用。

Thanks. 谢谢。

Don't try to manipulate the scrollbar directly - instead SetFocus() to the text window, then send Page Down messages. 不要尝试直接操纵滚动条-而是SetFocus()到文本窗口,然后发送Page Down消息。 If there are applications where you must manipulate the scrollbar, you should get its window handle and send the messages there. 如果在某些应用程序中必须操纵滚动条,则应获取其窗口句柄并在其中发送消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM