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

Thread: Path Name

  1. #1
    Join Date
    Dec 2004
    Posts
    106

    Smile Path Name

    Hai..

    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
    Location
    India
    Posts
    238

    Post Re: Path Name

    ur problem is not so well clear as u hav tried to....
    u are opening this file from ur program
    OR
    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

    Virender

  3. #3
    Join Date
    Dec 2004
    Posts
    106

    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
    Posts
    4,954

    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.

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

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center