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.

81 lines
2.2 KiB

  1. #ifndef PASSWORD_H_INCLUDED
  2. #define PASSWORD_H_INCLUDED
  3. // password dialog (used for users cpl)
  4. class CPasswordDialog: public CDialog
  5. {
  6. public:
  7. CPasswordDialog(TCHAR* pszResourceName, TCHAR* pszDomainUser, DWORD cchDomainUser,
  8. TCHAR* pszPassword, DWORD cchPassword, DWORD dwError):
  9. m_pszResourceName(pszResourceName),
  10. m_pszDomainUser(pszDomainUser),
  11. m_cchDomainUser(cchDomainUser),
  12. m_pszPassword(pszPassword),
  13. m_cchPassword(cchPassword),
  14. m_dwError(dwError)
  15. {}
  16. protected:
  17. // Message handlers
  18. virtual INT_PTR DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  19. BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
  20. BOOL OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
  21. // Data
  22. TCHAR* m_pszResourceName;
  23. TCHAR* m_pszDomainUser;
  24. DWORD m_cchDomainUser;
  25. TCHAR* m_pszPassword;
  26. DWORD m_cchPassword;
  27. DWORD m_dwError;
  28. };
  29. // base class containing common stuff for the password prop page and set password dialog
  30. class CPasswordPageBase
  31. {
  32. public:
  33. CPasswordPageBase(CUserInfo* pUserInfo): m_pUserInfo(pUserInfo) {}
  34. protected:
  35. // Helpers
  36. BOOL DoPasswordsMatch(HWND hwnd);
  37. protected:
  38. // Data
  39. CUserInfo* m_pUserInfo;
  40. };
  41. class CPasswordWizardPage: public CPropertyPage, public CPasswordPageBase
  42. {
  43. public:
  44. CPasswordWizardPage(CUserInfo* pUserInfo): CPasswordPageBase(pUserInfo) {}
  45. protected:
  46. // Message handlers
  47. virtual INT_PTR DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  48. BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
  49. BOOL OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
  50. BOOL OnNotify(HWND hwnd, int idCtrl, LPNMHDR pnmh);
  51. };
  52. class CChangePasswordDlg: public CDialog, public CPasswordPageBase
  53. {
  54. public:
  55. CChangePasswordDlg(CUserInfo* pUserInfo): CPasswordPageBase(pUserInfo) {}
  56. // Message handlers
  57. virtual INT_PTR DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  58. BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
  59. BOOL OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
  60. };
  61. #endif //!PASSWORD_H_INCLUDED