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.
Printable View
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.
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
Shouldn't the snippets & functions & API calls & such like that work for 98 also work for 2000?
Not always. There are some pieces of code that work on 9x, but not NT and vice versa.
This one seemed to work when I tried it in 2000.
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?
DING DING DING!!!!
If in doubt, stick "Ex" on the end of something :rolleyes:
This is definitely only NT4+, though.Quote:
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
);
Given the exe name, is there an API to get the title (form caption) if the application is running?