The GetModuleFileName function retrieves the full path and filename for the executable file containing the specified module.
Windows 95: The GetModuleFilename function will return long filenames when an application抯 version number is greater than or equal to 4.00 and the long filename is available. Otherwise, it returns only 8.3 format filenames.
DWORD GetModuleFileName(
HMODULE hModule, // handle to module to find filename for
LPTSTR lpFilename, // pointer to buffer for module path
DWORD nSize // size of buffer, in characters
);
int GetWindowText(
HWND hWnd, // handle to window or control with text
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum number of characters to copy
);