Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.7 KiB

  1. // AddRemove.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "wialogcfg.h"
  5. #include "AddRemove.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CAddRemove dialog
  13. CAddRemove::CAddRemove(CWnd* pParent /*=NULL*/)
  14. : CDialog(CAddRemove::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CAddRemove)
  17. m_NewKeyName = _T("");
  18. m_StatusText = _T("");
  19. //}}AFX_DATA_INIT
  20. }
  21. void CAddRemove::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(CAddRemove)
  25. DDX_Text(pDX, IDC_EDIT_KEYNAME, m_NewKeyName);
  26. DDX_Text(pDX, IDC_STATUS_TEXT, m_StatusText);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(CAddRemove, CDialog)
  30. //{{AFX_MSG_MAP(CAddRemove)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CAddRemove message handlers
  35. void CAddRemove::OnOK()
  36. {
  37. UpdateData(TRUE);
  38. if(m_NewKeyName.IsEmpty()) {
  39. MessageBox("Please enter a Module Name, or\npress 'Cancel' to exit.",m_szTitle,MB_ICONERROR|MB_OK);
  40. } else {
  41. CDialog::OnOK();
  42. }
  43. }
  44. void CAddRemove::SetTitle(TCHAR *pszDlgTitle)
  45. {
  46. lstrcpy(m_szTitle,pszDlgTitle);
  47. }
  48. void CAddRemove::SetStatusText(TCHAR *pszStatusText)
  49. {
  50. m_StatusText = pszStatusText;
  51. }
  52. BOOL CAddRemove::OnInitDialog()
  53. {
  54. CDialog::OnInitDialog();
  55. SetWindowText(m_szTitle);
  56. UpdateData(FALSE);
  57. return TRUE; // return TRUE unless you set the focus to a control
  58. // EXCEPTION: OCX Property Pages should return FALSE
  59. }
  60. void CAddRemove::GetNewKeyName(TCHAR *pszNewKeyName)
  61. {
  62. lstrcpy(pszNewKeyName,m_NewKeyName);
  63. }