Click here to Skip to main content
15,919,341 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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?
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900