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.

106 lines
3.6 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : DlgConfirmPassword.h //
  3. // //
  4. // DESCRIPTION : Header file for the CDlgConfirmPassword class. //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Jul 27 2000 yossg Create //
  10. // //
  11. // Windows XP //
  12. // Feb 11 2001 yossg Changed to include Credentials and Confirm //
  13. // //
  14. // Copyright (C) 2000 Microsoft Corporation All Rights Reserved //
  15. /////////////////////////////////////////////////////////////////////////////
  16. #ifndef DLG_CONFIRM_PASSWORD_INCLUDED
  17. #define DLG_CONFIRM_PASSWORD_INCLUDED
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CDlgConfirmPassword
  20. class CDlgConfirmPassword :
  21. public CDialogImpl<CDlgConfirmPassword>
  22. {
  23. public:
  24. CDlgConfirmPassword();
  25. ~CDlgConfirmPassword();
  26. enum { IDD = IDD_CONFIRM_PASSWORD };
  27. BEGIN_MSG_MAP(CDlgConfirmPassword)
  28. MESSAGE_HANDLER ( WM_INITDIALOG, OnInitDialog)
  29. COMMAND_ID_HANDLER( IDOK, OnOK)
  30. COMMAND_ID_HANDLER( IDCANCEL, OnCancel)
  31. MESSAGE_HANDLER( WM_CONTEXTMENU, OnHelpRequest)
  32. MESSAGE_HANDLER( WM_HELP, OnHelpRequest)
  33. COMMAND_HANDLER( IDC_SMTP_USERNAME_EDIT, EN_CHANGE, OnTextChanged)
  34. COMMAND_HANDLER( IDC_SMTP_PASSWORD_EDIT, EN_CHANGE, OnPasswordChanged)
  35. COMMAND_HANDLER( IDC_CONFIRM_PASSWORD_EDIT, EN_CHANGE, OnPasswordChanged)
  36. END_MSG_MAP()
  37. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  38. LRESULT OnOK (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  39. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  40. LRESULT OnPasswordChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  41. LRESULT OnTextChanged (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  42. HRESULT InitCredentialsDlg(BSTR bstrUserName);
  43. inline BOOL IsPasswordModified()
  44. {
  45. return m_fIsPasswordChangedAndConfirmed;
  46. }
  47. inline WCHAR * GetPassword()
  48. {
  49. return m_bstrPassword.m_str;
  50. }
  51. inline const CComBSTR& GetUserName()
  52. {
  53. return m_bstrUserName;
  54. }
  55. //
  56. // Help
  57. //
  58. LRESULT OnHelpRequest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  59. private:
  60. //
  61. // Methods
  62. //
  63. VOID EnableOK(BOOL fEnable);
  64. BOOL IsValidData(
  65. BSTR bstrUserName,
  66. BSTR bstrPassword,
  67. /*[OUT]*/int *pCtrlFocus);
  68. //
  69. // Controls
  70. //
  71. CEdit m_UserNameBox;
  72. CEdit m_PasswordBox;
  73. CEdit m_ConfirmPasswordBox;
  74. //
  75. // members for data
  76. //
  77. BOOL m_fIsPasswordDirty;
  78. BOOL m_fIsConfirmPasswordDirty;
  79. BOOL m_fIsPasswordChangedAndConfirmed;
  80. BOOL m_fIsDialogInitiated;
  81. CComBSTR m_bstrUserName;
  82. CComBSTR m_bstrPassword;
  83. };
  84. #endif // DLG_CONFIRM_PASSWORD_INCLUDED