Total Pageviews

Thursday, May 13, 2010

Lesson 14 - GetModuleFileName

#include
#include
#include
#include
using namespace std;

int _tmain( int argc, _TCHAR* argv[] )
{
TCHAR szEXEPath[ 2048 ];
DWORD nChars = GetModuleFileName( NULL, szEXEPath, 2048 );

cout << '\n'; for (DWORD n = 10; n <= nChars; n += 10) cout << " " << (n / 10); cout << '\n'; for (DWORD n = 1; n <= nChars; n++) cout << (n % 10); cout << '\n'; cout << szEXEPath << '\n'; cout << nChars << " characters.\n"; // Pause cout << "\n\nPress Enter to quit..." << flush; cin.ignore( numeric_limits ::max(), '\n' );
return 0;
}

No comments:

Post a Comment