如何消除 Microsoft Word 的焦点?文档窗口?
我正在Delphi中开发一个Word插件,在任务窗格上我放置了一个虚拟树视图,在虚拟树视图的OnFocus事件中我调用Word通过方法ActiveDocument.Range.InsertFile将文件插入到当前Word文档中,但是这个操作会将输入焦点放回 Word 文档窗口,因此最后在此事件处理程序中我调用 TreeView.SetFocus 将焦点设置回树视图,除了 Word 文档窗口仍然显示不闪烁的插入符号外,此操作有效。
我尝试将 WM_KILLFOCUS Windows 消息发送到 Word 文档窗口的句柄,但没有成功。有什么提示吗?先感谢您!
I'm developing a Word addin in Delphi, on a task pane I put a Virtual treeview, in the OnFocus event of the Virtual Treeview I call Word to insert a file into the current Word document via method ActiveDocument.Range.InsertFile, but this operation will put the input focus back to the Word document window, so finally in this event handler I call TreeView.SetFocus to set the focus back to the treeview, this works except that the Word document window still has a unblinking caret shown.
I tried sending the WM_KILLFOCUS windows message to the handle of the Word document window but no luck. Any hints? Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试调用Application.BringToFront或Application.MainForm.BringToFront。
You can try to call Application.BringToFront or Application.MainForm.BringToFront.