如何判断 Office 剪贴板集合是否已打开? [英] How can I tell if Office Clipboard collection is turned on?

查看:56
本文介绍了如何判断 Office 剪贴板集合是否已打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Office剪贴板收藏是否开启.这是保存最近 24 个剪贴板数据的剪贴板窗格.在 Office 2007 和 2010 上,您可以通过展开主页功能区上的剪贴板区域来获取它,而在 Office 2003 中,您可以从任务窗格区域中打开它,然后从菜单中选择剪贴板.

I want to know whether the Office clipboard collection is turned on. This is the clipboard pane that saves the last 24 clipboard data. On Office 2007 and 2010 you get it by expanding the clipboard area on the Home ribbon, and in Office 2003 you can open it from the task pane area, and selecting clipboard from the menu.

我有一个 Office 插件.

I've an Office plugin.

尽管我正在做各种 API 挂钩(使用 IAT),但我正在寻找最简单的解决方案.

Although I'm doing all sort of API hooking (using IAT), I'm looking for the simplest solution.

  1. 我最初的想法是寻找一个标题为Collect and Paste 2.0"的窗口(用 Spy++ 自己检查),以及各种 Windows 类(例如在 Word 中它是 bosa_sdm_msword).但是,用户可以选中收集而不显示 Office 剪贴板",然后重新启动 Office.此时,Office 将在没有任何迹象的情况下收集数据.

  1. My initial idea was to look for a window with title: "Collect and Paste 2.0" (check out yourself with Spy++), with various Windows class (e.g. in Word it is bosa_sdm_msword). However, users can check the 'Collect without showing Office clipboard', and restart Office. At this point, Office will collect data without any sign to the Window.

我正在查看注册表项:Software\Microsoft\Office\%d.0\Common\General\AcbOn.这很酷,但直到用户退出 Office 才会保存此条目.因此,用户可以打开不同的应用程序、打开收藏、关闭窗口.

I am looking at registry key: Software\Microsoft\Office\%d.0\Common\General\AcbOn. This is cool, but this entry isn't saved until user exit Office. Hence, users can open a different application, turn on collection, close the window.

Office 剪贴板在通知区域中创建一个图标.参见问题:如何获取通知区域图标列表?.不幸的是,这个问题没有答案.如果您知道此问题的答案,请在此处或在该问题上回复(您将获得两次 +1!)

Office clipboard creates an icon in the notification area. See question: how to acquire list of notification area icons?. Unfortunately, this question got no answer that work. If you know the answer for this, please reply here or on that question (you'll get +1 twice!)

正如我所说,我在应用程序的进程中,我能够拦截任何具有导出符号的东西,但我想尽量减少对应用程序的影响.例如,拦截发送消息或子类化窗口都会影响 Office 应用程序的性能(在某些情况下:稳定性).

As I said, I'm inside the process of the application and I'm able to intercept anything that has an export symbol, but I'd like to minimize the effect on the application. For example, intercepting send message, or subclassing a Window will have an effect on the performance (and in some cases: stability) of the Office application.

在 Office 2003 中有一个类名为 ('ActiveClipboard') 的窗口,但我在 2007 和 2010 上找不到它.另一方面,我看到 WM_USER+2304,我不知道它是什么是.

In Office 2003 there is a window with a class named ('ActiveClipboard'), but I can't find it on 2007 and 2010. On the other hand I see WM_USER+2304, which I don't know what it is.

有人走过这条路吗?有什么提示吗?

Has anyone went through that path? Any hint?

推荐答案

回答我自己的问题:

据我所知,Office 在对象模型中没有任何事件或 API 来告诉您 Office 是否正在收集剪贴板.但是,这两种方法的组合对我有用:

As far as I can tell, Office doesn't have any event or API in the object model to tell you whether Office is collecting the clipboard. However, the combination of these two methods is working for me:

  1. 枚举系统中的所有窗口,并搜索具有以下属性(分别为类名/标题)的窗口:

  1. Enumerate all windows in the system, and search for a Window with the following attributes (class name/title respectively):

Word 2010:bosa_sdm_msword"、收集和粘贴 2.0"Word 2003:bosa_sdm_Microsoft Office Word 11.0"、收集和粘贴 2.0"Word 2007:bosa_sdm_Microsoft Office Word 12.0"、收集和粘贴 2.0"Excel(全部):bosa_sdm_XL9", "Collect and Paste 2.0"PowerPoint (all): "bosa_sdm_Mso96", L"Collect and Paste 2.0"

Word 2010: "bosa_sdm_msword", "Collect and Paste 2.0" Word 2003: "bosa_sdm_Microsoft Office Word 11.0", "Collect and Paste 2.0" Word 2007: "bosa_sdm_Microsoft Office Word 12.0", "Collect and Paste 2.0" Excel (all): bosa_sdm_XL9", "Collect and Paste 2.0" PowerPoint (all): "bosa_sdm_Mso96", L"Collect and Paste 2.0"

如果存在这样的窗口,则意味着 Office 正在收集剪贴板数据.

If such a window exists, this means Office is collecting clipboard data.

搜索注册表项:HKCR\Software\Microsoft\Office\14.0\Common\General\AcbOn (REG_DWORD).值 1 表示 Office 正在收集数据.

Search registry key: HKCR\Software\Microsoft\Office\14.0\Common\General\AcbOn (REG_DWORD). A value of 1 well tell you Office is collecting data.

这篇关于如何判断 Office 剪贴板集合是否已打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆