I am beginer to C#.
I am developing Password Pro application in that i want to automatically detect the password of currently opened file application from access database file .
Generally we have secured our data in password protected file say docx, xls, pdf etc.
I want to make application such that when i cliked on particular password protected file the password gets detected from database and simply shown to user.
I have captured the title of currently opened window i.e. "Enter the password" window which is child window of any application like docx, pdf etc.
But I want to need the title of file i.e. file name of currently opened application.
for example demo.pdf, op.docx etc.
when i clicked on say demo.pdf i want to need this demo.pdf(file name)
Please anybody help me and give me code that are need for getting this currently opened document application filename.
Probably, what you want to do will not work in many (if not most) cases.
For one thing, you can't rely on a parent window title containing the file name - it may, but it may only contain the file name after the password has been correctly entered and not before.
Secondly, the parent title may not contain the extension, and very often does not contain a path, so you may be able to get the file name, but have no idea which one it is, or where it is.
Thirdly, you can't even rely on open file handles, because most modern programs open the file, read it, and close it again - if only so that it causes little or no interruption for backup programs. so the file won't be open when the "enter password" dialog is showing.
To be honest, I think you are going to find that even a combination of methods is going to give you poor results and would suggest that you re-think your application. This is likely to give you more trouble that it is worth.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)