用Visual C++实现屏幕抓程序(9)
void CCaptureDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCaptureDlg)
DDX_Control(pDX, IDC_KEY, m_Key);
DDX_Check(pDX, IDC_CONTROL, m_bControl);
DDX_Check(pDX, IDC_ALT, m_bAlt);
DDX_Check(pDX, IDC_SHIFT, m_bShift);
DDX_Text(pDX, IDC_PATH, m_Path);
DDX_Text(pDX, IDC_NUMBER, m_Number);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCaptureDlg, CDialog)
//{{AFX_MSG_MAP(CCaptureDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(ID_ABOUT, OnAbout)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_BN_CLICKED(ID_CHANGE, OnChange)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CCaptureDlg::OnInitDialog()
{
CDialog::OnInitDialog();
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_Key.SetCurSel(0);
RegisterHotkey();
CMenu* pMenu=GetSystemMenu(FALSE);
pMenu->DeleteMenu(SC_MAXIMIZE,MF_BYCOMMAND);
pMenu->DeleteMenu(SC_SIZE,MF_BYCOMMAND);
pMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);
return TRUE; // return TRUE unless you set the focus to a control
}
void CCaptureDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
- 上一篇:VC++中实现以复杂线条为基础的图形绘图
- 下一篇:通过例程分析状态条用法