ex43.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:1k
源码类别:
书籍源码
开发平台:
Visual C++
- #include <ex43.h>//包含ex43.h头文件
- BEGIN_MESSAGE_MAP(CMainWnd,CFrameWnd)
- ON_WM_LBUTTONDOWN() //缺省的消息映射
- ON_WM_RBUTTONDOWN() //缺省的消息映射
- END_MESSAGE_MAP()
- void CMainWnd::OnLButtonDown(UINT nFlags,CPoint point)
- {
- MessageBox("左键单击");
- CFrameWnd::OnLButtonDown(nFlags,point);//让基类再做处理
- }
- void CMainWnd::OnRButtonDown(UINT nFlags,CPoint point)
- {
- MessageBox("右键单击");
- CFrameWnd::OnRButtonDown(nFlags,point);
- }
- BOOL CMyApp::InitInstance()
- {
- CMainWnd*p=new CMainWnd;
- p->Create(0,"MFC");
- this->m_pMainWnd=p;
- p->ShowWindow(SW_NORMAL);
- p->UpdateWindow();
- return TRUE;
- }
- CMyApp myapp;