DuplicateDlg.h
上传用户:hy_wanghao
上传日期:2007-01-08
资源大小:279k
文件大小:1k
- #if !defined(AFX_DUPLICATEDLG_H__20010104_E6E8_99B0_68F5_0080AD509054__INCLUDED_)
- #define AFX_DUPLICATEDLG_H__20010104_E6E8_99B0_68F5_0080AD509054__INCLUDED_
- #pragma once
- // The duplicate dialog is really a message box, which
- // warns the user that he's about to overwrite files.
- // It offers a "Yes", "No", "Cancel" and "Yes to all" button.
- class CDuplicateDlg :
- public CDialogImpl<CDuplicateDlg>
- {
- public:
- enum {IDD = IDD_COLLISION};
- BEGIN_MSG_MAP(CDuplicateDlg)
- MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
- COMMAND_ID_HANDLER(IDOK, OnButtonClick)
- COMMAND_ID_HANDLER(IDCANCEL, OnButtonClick)
- COMMAND_ID_HANDLER(IDNO, OnButtonClick)
- COMMAND_ID_HANDLER(IDYESTOALL, OnButtonClick)
- END_MSG_MAP()
- LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
- {
- ATLASSERT(m_pstrFileName);
- ATLASSERT(m_pstrType);
- CResString<512> sFormat(IDS_REPLACE);
- TCHAR szTitle[512];
- ::wsprintf(szTitle, sFormat, m_pstrType, m_pstrFileName);
- SetDlgItemText(IDC_TEXT, szTitle);
- ::MessageBeep(MB_ICONQUESTION); // Beep the user! Ala ::MessageBox() alert...
- return 0;
- }
- LRESULT OnButtonClick(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
- {
- EndDialog(wID);
- return 0;
- }
- public:
- LPCTSTR m_pstrFileName;
- LPCTSTR m_pstrType;
- };
- #endif // !defined(AFX_DUPLICATEDLG_H__20010104_E6E8_99B0_68F5_0080AD509054__INCLUDED_)