Results 1 to 9 of 9

Thread: full path & file name from handle?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    18
    Is there a way to get the the full path and file name with only knowing the handle of the window?

    Any code/api's will help.

  2. #2

  3. #3
    Guest
    Has anyone found/written a method that works for Windows 2000? I've seen several that work for windows 98 but I need one for windows 2000 compatibility.

    Thanks

  4. #4
    Member PatrickCorgan's Avatar
    Join Date
    Feb 2001
    Location
    Vashon Island, WA, USA
    Posts
    39
    Shouldn't the snippets & functions & API calls & such like that work for 98 also work for 2000?
    -Patrick
    Visual Basic 6 SP5
    Master Programmer Wannabe

    Check out the API-Guide for all your API needs!

    --Soli Deo Gloria--

  5. #5
    Guest
    Not always. There are some pieces of code that work on 9x, but not NT and vice versa.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    This one seemed to work when I tried it in 2000.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Guest
    It only sort of works. On Windows 2000 it will only return the .EXE name of the given handle, but on Windows 9x it returns the entire path of the given handle. Does anyone have one that works for 2000?

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    DING DING DING!!!!

    If in doubt, stick "Ex" on the end of something

    GetModuleFileNameEx
    The GetModuleFileNameEx function retrieves the fully qualified path for the specified module.

    DWORD GetModuleFileNameEx(
    HANDLE hProcess, // handle to process
    HMODULE hModule, // handle to module
    LPTSTR lpFilename, // path buffer
    DWORD nSize // maximum characters to retrieve
    );
    This is definitely only NT4+, though.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    Guest

    Get form caption from exe name

    Given the exe name, is there an API to get the title (form caption) if the application is running?

Posting Permissions

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



Click Here to Expand Forum to Full Width