Word文件滚动位置 [英] Word File scroll position
本文介绍了Word文件滚动位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何从C ++应用程序获取和设置正在运行的Word文件的滚动位置吗?例如,我在程序中使用Shellexecute调用运行Word,但是我想恢复文件中的最后一个已知滚动位置.
Does anyone know how to get and set the scroll position of a running Word file from a C++ application? For example I am running Word using a Shellexecute call in my program but I want to restore the last known scroll position in the file.
推荐答案
您可以尝试发送 SBM_SETSCROLLINFO [ FindWindowEx [ SBM_GETPOS [
You could try sending the SBM_SETSCROLLINFO[^] message directly to the scroll bar control in Word. The vertical scrollbar should have the caption "Vertical". You can use FindWindowEx[^] to find the vertical scrollbar if you have the parent handle. I believe you can call SBM_GETPOS [^] to get the current position of the scroll bar.
回答第二个问题:
例如,使用Word应用程序的父句柄(parent_hwndN),可以尝试以下操作:
To answer your second question:
For example, using the parent handle (parent_hwndN) for the Word application, you can try this:
vscr_hwnd= FindWindowEx(
parent_hwndN,
NULL,
"NUIScrollbar",
"Vertical",
);
感谢您的回复.我确实有父句柄,但是在使用FindWindowEx时遇到了麻烦.这是获取垂直滚动条的正确形式吗?
vscr_hwnd = :: FindWindowEx(
parent_hwndN,
NULL,
垂直",
NULL
);
Thanks for your response. I do have the parent handle but I am having trouble w/FindWindowEx. Is this the proper form to get the vertical scrollbar?
vscr_hwnd=::FindWindowEx(
parent_hwndN,
NULL,
"Vertical",
NULL
);
这篇关于Word文件滚动位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文