Professional Documents
Culture Documents
Message
Windows Procedure
Painting Window
Closing Window
Events generated from the keyboard, mouse
and operating system.
Win32c Program
#ifndef UNICODE
#define UNICODE
#endif
#include <windows.h>
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
RegisterClass(&wc);
//Create the window
HWND hwnd = CreateWindowEx(0,CLASS_NAME,L”Learn to Program Windows”, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULUT,NULL,NULL,hInstance,NULL);
if(hwnd == NULL)
return 0;
ShowWindow(hwnd, nCmdShow);
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd,&ps);
DECLARE_MESSAGE_MAP()
}
MyApp.cpp Sample MFC application
-----------------------------------------------------------------------------
#include <afxwin.h>
#include <myapp.h”
BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT(()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{
Create(NULL, “MYAPP Application”);
}
void CMyFrame::OnLButton(UINT nFlags,CPoint point)
{
TRACE(“Entering CMyFrame::OnLButtonDown - %lx,%d,%d\n”,nFlags,pont.x,point.y);
}
void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0,0,”Hello word”);
}
On Application ShutDown()
Events that are Fire Down
Window is Destroyed
Exit from Message Loop
Exit from WinMain
1.It has five objects that involves
CWinApp,CFrameWnd,CDocument,CView,CDocTemplateClass
if(ar.IsStoring())
ar << StudentNo << StudentName << StudentAddr;
else
ar >> StudentNo >> StudentName >> StudentAddr;
}
What is a Root base class?
Thank You