Hi. All
I want to get C function about Get opened file path from window handle.
(not file handle and not executable path)
for example,
If c:\abc\[login to view URL] is opened using [login to view URL], and if we know winword's main window handle,
I want to get 'c:\abc\[login to view URL]'.
caution :
1) it is support that when read-only file is opened, and if we know window handle.
we get opened file path from window handle
2) it is support MDI Child window (like excel or powerpnt...)
3) Win XP, WIn 7, WIn VISTA support (32 bits)
4) I need source file and project files
target function :
Bool GetOpenFilePath(HWND, wchar *filepathvar)
if true, opened file path is saved to filepathvar, and return true.
if false, return false
test scenario.
1. create c:\[login to view URL], and open c:\[login to view URL] using [login to view URL],
if winword's window handle is 0x1234,
We get opened file path using below function
==> GetOpenFilePath(0x1234, filepathvar)
if true, filepathvar is 'c:\[login to view URL];
2. create c:\readonly\[login to view URL], and set c:\readonly\[login to view URL] file as readonly,
and open c:\readonly\[login to view URL] using [login to view URL],
if winword's window handle is 0x5678,
We get opened file(read only file) path using below function
==> GetOpenFilePath(0x5678, filepathvar)
if true, filepathvar is 'c:\readonly\[login to view URL]'
3. create c:\[login to view URL], c:\[login to view URL] 2 files. (c:\[login to view URL] is normal file, and c:\[login to view URL] is readonly file)
and open c:\[login to view URL], c:\[login to view URL] (using [login to view URL])
Now, Excel window have 2 child windows ([login to view URL], [login to view URL])
assume that we know child window handle
([login to view URL] => 0x1000 child window handle, [login to view URL] => 0x2000 child window handle)
if we use GetOpenFilePath(0x1000, filepathvar)
if true, filepathvar is 'c:\[login to view URL]'
if we use GetOpenFilePath(0x2000, filepathvar)
if true, filepathvar is 'c:\[login to view URL]'
Hello.
I have already made this function.
If you want, i can provide screenshot about this.
If you choose me, i want to chat with you for details.
Looking forward to your response.
Thanks.
Hello. How are you?
I know what you want and how to do it. I have techniques of windows process management and hooking.
This project is in my power.
Best regards.