The GetWindowModuleFileName function retrieves the full path and file name of the module associated with the specified window handle.
Syntax
UINT GetWindowModuleFileName( HWND hwnd, LPTSTR lpszFileName, UINT cchFileNameMax );
Parameters
hwnd [in] Handle to the window whose module file name will be retrieved. lpszFileName [out] Pointer to a buffer that receives the path and file name. cchFileNameMax [in] Specifies the maximum number of TCHARs that can be copied into the lpszFileName buffer.
Return Value
The return value is the total number of TCHARs copied into the buffer.
Remarks
Windows 95/98/Me: GetWindowModuleFileNameW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
Function Information
Minimum DLL Versionuser32.dllHeaderDeclared in Winuser.h, include Windows.hImport libraryUser32.libMinimum operating systems Windows 95, Windows NT 4.0 SP3UnicodeImplemented as ANSI and Unicode versions.
See Also
Windows Overview