龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

用Visual C++实现屏幕抓程序(9)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
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(

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);
 }
}

精彩图集

赞助商链接