// MainFrm.cpp : implmentation of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "aboutdlg.h"
#include "WTLClockView.h"
#include "MainFrm.h"
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if(CFrameWindowImpl<CMainFrame>::PreTranslateMessage(pMsg))
return TRUE;
return m_view.PreTranslateMessage(pMsg);
}
BOOL CMainFrame::OnIdle()
{
return FALSE;
}
LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
// register object for message filtering and idle updates
CMessageLoop* pLoop = _Module.GetMessageLoop();
ATLASSERT(pLoop != NULL);
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);
// Set the initial state of the Clock menu items:
UIEnable ( IDC_START, false );
UIEnable ( IDC_STOP, true );
return 0;
}
LRESULT CMainFrame::OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
PostMessage(WM_CLOSE);
return 0;
}
LRESULT CMainFrame::OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: add code to initialize document
return 0;
}
LRESULT CMainFrame::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CAboutDlg dlg;
dlg.DoModal();
return 0;
}
void CMainFrame::OnStart(UINT uCode, int nID, HWND hwndCtrl)
{
// Enable Stop and disable Start
UIEnable ( IDC_START, false );
UIEnable ( IDC_STOP, true );
// Tell the view to start its clock.
m_view.StartClock();
}
void CMainFrame::OnStop(UINT uCode, int nID, HWND hwndCtrl)
{
// Enable Start and disable Stop
UIEnable ( IDC_START, true );
UIEnable ( IDC_STOP, false );
// Tell the view to stop its clock.
m_view.StopClock();
}
WTL_Clock.rar_wtl_显示时间
版权申诉
59 浏览量
2022-09-24
12:48:22
上传
评论
收藏 19KB RAR 举报
刘良运
- 粉丝: 66
- 资源: 1万+
最新资源
- 【实务学习资料】python的Excel自动处理学习资料
- 2000-2020年全球194个国家双边贸易进口额出口额进出口总额
- 2003-2019全国各省地级市工业废水排放量城市废水排放量面板数据-Excel完整版
- 北京大学中国商业银行数字化转型指数 2010-2021年EXCEL
- 各国反补贴措施数量指标2000-2020-反补贴措施-贸易壁垒情况
- MFC 列表控件添加修改删除实例
- 2000-2021年 44指标 美国国际收支平衡表 德国国际收支平衡表 印度 中国国际收支平衡表
- Stata空间面板模型(slm,sem,sdm)包括do文件,样例数据和详细说明
- 重磅更新上市公司高管团队异质性数据处理Stata代码(2008-2022年数据)
- 基于QT+C++实现的文本或窗口炫酷有趣的滚动条-果冻条+源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈