Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends!!
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.
Posted

1 solution

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.
 
Share this answer
 
Comments
sham bhand 16-Feb-13 10:36am    
Is there any way to getting or capturing whole text of enter password dialog box,
because on dialog box contain name of file name with extension.
sham bhand 18-Feb-13 10:04am    
I want to required file name of my currently opened document application(like pdf,docx,xls etc) in order to automatically detect the password from my access database.
But when i clicked on my external application the "password" window gets opened since my file application is password protected, still file application not opened because i have not entered password still, i want to supply this password as auto detection from database.
For this project i have got the title of currently active window i.e. password but i want to know the which file name, of application.

The filename with extension is present on external application(pdf,docx,xls)"enter password" dialog box or window.
So my question is that is there any way to read out this "filename+extension " present on "enter password" dialog box of external application(like pdf,docx,xls etc).

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