|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Visual Studio .NET 2003
The pointer returned by this function can be used to access application information such as the main message-dispatch code or the topmost window.
CWinApp* AFXAPI AfxGetApp( );
A pointer to the single CWinApp object for the application.
// Print the application's executable filename. TRACE("Executable filename = %s\n", AfxGetApp()->m_pszExeName);