Path Name
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 4 of 4

Thread: Path Name

  1. #1
    Join Date
    Dec 2004

    Smile Path Name


    I have a small problem, let me explain.

    Suppose i have opened a file, name called d:\raghu\name.txt in the notepad application. Now i want to trace this path from my vc++ application. I have searched in the registry, but there is no use.

    Please let me know.

    Thanking you,
    E.Veera Raghavendra.

  2. #2
    Join Date
    Jul 2005

    Post Re: Path Name

    ur problem is not so well clear as u hav tried to....
    u are opening this file from ur program
    it has been opened by windows then ur are trying to get the path from ur project.
    plz clear this thing or explain ur demand for project


  3. #3
    Join Date
    Dec 2004

    Smile Re: Path Name

    the file is opened from the windows and i am trying to find the path from my application.

  4. #4
    Join Date
    May 2005

    Re: Path Name

    you can get the name of the file from notepad using the ::GetWindowText(..) api (since its there in the caption).
    and you can use the ::SearchTreeForFile(..) api to look for it on the disc.

    the cons for this solution:
    1) its slow.
    2) if there are multply files with the same name then there is a probelm.

    second solution that will work for sure (but its not easy) is to use API hooking you can hook the ::CreateFile(..) api for the Notepad.exe process and you will know exactly what files it opened cause you can monitor the params of CreateFile.

    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)