MainFrm.cpp
资源名称:MM.zip [点击查看]
上传用户:jyxwjx
上传日期:2020-03-13
资源大小:221k
文件大小:3k
源码类别:
多显示器编程
开发平台:
Visual C++
- // MainFrm.cpp : CMainFrame 努贰胶狼 备泅
- //
- #include "stdafx.h"
- #include "MM.h"
- #include "MainFrm.h"
- #include "Dialog1.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- // CMainFrame
- IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
- BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
- ON_WM_CREATE()
- ON_WM_DESTROY()
- ON_COMMAND(ID_VIEW_DIALOG, OnViewDialog)
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR, // 惑怕 临 钎矫扁
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- // CMainFrame 积己/家戈
- CMainFrame::CMainFrame()
- {
- // TODO: 咯扁俊 糕滚 檬扁拳 内靛甫 眠啊钦聪促.
- }
- CMainFrame::~CMainFrame()
- {
- int nCount = m_aryDlg.GetCount();
- for(int i=0;i<nCount;i++)
- {
- CDialog1* pDlg = (CDialog1*)m_aryDlg.GetAt(i);
- if(pDlg)
- delete pDlg;
- }
- m_aryDlg.RemoveAll();
- m_aryDlg.FreeExtra();
- }
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
- if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
- | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("档备 葛澜阑 父甸瘤 给沁嚼聪促.n");
- return -1; // 父甸瘤 给沁嚼聪促.
- }
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- TRACE0("惑怕 钎矫临阑 父甸瘤 给沁嚼聪促.n");
- return -1; // 父甸瘤 给沁嚼聪促.
- }
- // TODO: 档备 葛澜阑 档欧且 荐 绝霸 窍妨搁 捞 技 临阑 昏力窍绞矫坷.
- m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
- EnableDocking(CBRS_ALIGN_ANY);
- DockControlBar(&m_wndToolBar);
- return 0;
- }
- BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- if( !CMDIFrameWnd::PreCreateWindow(cs) )
- return FALSE;
- // TODO: CREATESTRUCT cs甫 荐沥窍咯 咯扁俊辑
- // Window 努贰胶 肚绰 胶鸥老阑 荐沥钦聪促.
- return TRUE;
- }
- // CMainFrame 柳窜
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CMDIFrameWnd::AssertValid();
- }
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CMDIFrameWnd::Dump(dc);
- }
- #endif //_DEBUG
- // CMainFrame 皋矫瘤 贸府扁
- void CMainFrame::OnDestroy()
- {
- CMDIFrameWnd::OnDestroy();
- int nCount = m_aryDlg.GetCount();
- for(int i=0;i<nCount;i++)
- {
- CDialog1* pDlg = (CDialog1*)m_aryDlg.GetAt(i);
- if(pDlg)
- pDlg->DestroyWindow();
- }
- }
- void CMainFrame::OnViewDialog()
- {
- CRect rcMonitor;
- for(int i=0;i<theApp.m_infoMonitor.aryMonitors.GetCount();i++)
- {
- CDialog1* pDlg = new CDialog1;
- pDlg->m_MonitorInfoEx=((MONITORINFOEX)theApp.m_infoMonitor.aryMonitors.GetAt(i));
- rcMonitor=pDlg->m_MonitorInfoEx.rcMonitor;
- pDlg->Create(this);
- pDlg->MoveWindow(rcMonitor);
- pDlg->ShowWindow(SW_SHOW);
- m_aryDlg.Add(pDlg);
- }
- }