Click to open or copy the HELLOAPP project files.
HELLOAPP is the minimal Microsoft® Foundation Class Library (MFC) sample, and illustrates how few lines of code are required simply to get a window to appear on the screen. HELLOAPP is even simpler than the HELLO sample: HELLOAPP does not paint anything in the main window's client area, nor does it even have a message map for the main window. HELLOAPP is nevertheless instructive in that it demonstrates the minimal overhead required for a content-less application, as opposed to, for example, a WinMain type of application developed using the Microsoft Windows® Software Development Kit.
When you run HELLOAPP, it displays "Hello World!" in the title bar of an empty application window.
Like any application written using MFC, HELLOAPP has a CWinApp-derived class. This application class provides a minimal implementation of InitInstance, which is to construct a frame window object (of the application-specific class CMainWindow
), and then call the window's ShowWindow
and UpdateWindow
functions.
This sample demonstrates the following keywords:
CFrameWnd::Create; CFrameWnd::rectDefault; CWinApp::InitInstance; ShowWindow; UpdateWindow