打开多个word文件时,WinWord文件监视。 C ++ [英] WinWord File monitoring, when multiple word files are opened. C++

查看:95
本文介绍了打开多个word文件时,WinWord文件监视。 C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个小软件,用密码加密文件,并将文件扩展名更改为其他内容。



Ex: - 普通文件---测试。加密后的docx成为Test.endocx。



当有人双击文件时,基于我的软件可以检测到的扩展名,它是一个加密的word文件,提供正确的密码,它将被解密并使用WinWord.exe打开。



文件打开后,我需要监控文件,当用户完成随着更改并关闭它,然后我需要检测文件已关闭,然后重新设置并存储它。



我的软件用于工作直到msoffice 2007.因为我曾经监控过程,但现在从办公室2010开始,只有一个进程可以运行所有已打开的ms文件。



我想知道什么时候多个如果有任何方法可以检测特定单词fi,则打开带有.docx扩展名的单词文件le是否关闭?

I wrote a small software which encrypts a file with a password and changes file extension to something else.

For Ex:- Normal file --- Test.docx after encryption it becomes Test.endocx.

When some one double clicks on the file, based on the extension my software can detect it is a encrypted word file, upon providing correct password it will be de-crypted and opened with WinWord.exe.

Once the file is opened, i need to monitor the file, when the user is done with the changes and close it, then i need to detect the file is closed and then resecure it and store it.

My software used to work untill msoffice 2007. because i used to monitor the processes, but now from office 2010 there will be only one process running for all the opened ms word files.

I would like to know when multiple word files with .docx extension are opened, if there is any way to detect if particular word file is closed or not?

推荐答案

一些选择...



1.使用加密文件系统(例如TrueCrypt或VeraCrypt)。



2.使用NtQueryInformationProcess获取WinWord打开的文件列表。



http ://www.codeguru.com/cpp/wp/system/processesmodules/article.php/c2827/Examine-Information-on-Windows-NT-System-Level-Primitives.htm [ ^ ]



3.应该有办法为Word编写插件或插件,但我没有找到了一个很好的参考。
Some choices ...

1. use an encrypting file system (eg. TrueCrypt or VeraCrypt).

2. Use NtQueryInformationProcess to get a list of files open by WinWord.

http://www.codeguru.com/cpp/w-p/system/processesmodules/article.php/c2827/Examine-Information-on-Windows-NT-System-Level-Primitives.htm[^]

3. There should be a way to write a plug-in or add-on to Word but I've not found a good reference.


这篇关于打开多个word文件时,WinWord文件监视。 C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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