Source code of Windows XP (NT5)
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.

166 lines
4.8 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. password.hxx
  7. Class declarations for the BASE_PASSWORD_DIALOG and
  8. RESOURCE_PASSWORD_DIALOG classes.
  9. The RESOURCE_PASSWORD_DIALOG class is used to get a password from
  10. the user and is derived from the more primitive BASE_PASSWORD_DIALOG.
  11. The former uses dialog resources in COMMON\XLATE. You may supply
  12. your own for the latter.
  13. FILE HISTORY:
  14. KeithMo 22-Jul-1991 Created for the Server Manager.
  15. Yi-HsinS 5-Oct-1991 Modified for general usage
  16. ChuckC 2-Feb-1992 made more general. Split off
  17. BASE_PASSWORD_DIALOG.
  18. KeithMo 07-Aug-1992 Added HelpContext parameters.
  19. */
  20. #ifndef _RESOURCE_PASSWORD_HXX
  21. #define _RESOURCE_PASSWORD_HXX
  22. /*************************************************************************
  23. NAME: BASE_PASSWORD_DIALOG
  24. SYNOPSIS: Retrieve a resource password from the user.
  25. INTERFACE: BASE_PASSWORD_DIALOG - Class constructor.
  26. ~BASE_PASSWORD_DIALOG - Class destructor.
  27. OnOK - Called when the user presses the
  28. "OK" button.
  29. QueryHelpContext - Called when the user presses "F1"
  30. or the "Help" button. Used for
  31. selecting the appropriate help
  32. text for display.
  33. QueryPassword - To retrieve the password the user
  34. typed in
  35. PARENT: DIALOG_WINDOW
  36. USES: PASSWORD_CONTROL
  37. SLT
  38. HISTORY:
  39. ChuckC 2-Feb-1992 Created
  40. **************************************************************************/
  41. DLL_CLASS BASE_PASSWORD_DIALOG : public DIALOG_WINDOW
  42. {
  43. private:
  44. //
  45. // The name of the resource.
  46. //
  47. SLT _sltTarget;
  48. SLT * _psltTarget2;
  49. SLT * _psltText;
  50. //
  51. // This control represents the "secret" password edit field
  52. // in the dialog.
  53. //
  54. PASSWORD_CONTROL _passwdCtrl;
  55. //
  56. // help context
  57. //
  58. ULONG _ulHelpContext ;
  59. protected:
  60. //
  61. // Called during help processing to select the appropriate
  62. // help text for display.
  63. //
  64. virtual ULONG QueryHelpContext( VOID );
  65. public:
  66. //
  67. // Usual constructor/destructor goodies.
  68. //
  69. BASE_PASSWORD_DIALOG( HWND hwndParent,
  70. const TCHAR *pszResource,
  71. CID cidTarget,
  72. CID cidPassword,
  73. ULONG ulHelpContext,
  74. const TCHAR *pszTarget,
  75. UINT npasswordLen,
  76. CID cidTarget2 = 0,
  77. const TCHAR *pszTarget2 = NULL,
  78. CID cidText = 0,
  79. const TCHAR *pszText = NULL);
  80. ~BASE_PASSWORD_DIALOG();
  81. //
  82. // Retrieve the password in the PASSWORD_CONTROL
  83. //
  84. APIERR QueryPassword( NLS_STR *pnlsPassword )
  85. { return _passwdCtrl.QueryText( pnlsPassword ); }
  86. }; // class BASE_PASSWORD_DIALOG
  87. /*************************************************************************
  88. NAME: RESOURCE_PASSWORD_DIALOG
  89. SYNOPSIS: Retrieve a resource password from the user.
  90. INTERFACE: RESOURCE_PASSWORD_DIALOG - Class constructor.
  91. ~RESOURCE_PASSWORD_DIALOG - Class destructor.
  92. QueryHelpContext - Called when the user presses "F1"
  93. or the "Help" button. Used for
  94. selecting the appropriate help
  95. text for display.
  96. PARENT: BASE_PASSWORD_DIALOG
  97. USES:
  98. HISTORY:
  99. KeithMo 22-Jul-1991 Created for the Server Manager.
  100. Yi-HsinS 5-Oct-1991 Added QueryPassword and change the constructor
  101. **************************************************************************/
  102. DLL_CLASS RESOURCE_PASSWORD_DIALOG : public BASE_PASSWORD_DIALOG
  103. {
  104. private:
  105. protected:
  106. public:
  107. //
  108. // Usual constructor/destructor goodies.
  109. //
  110. RESOURCE_PASSWORD_DIALOG( HWND hwndParent,
  111. const TCHAR *pszTarget,
  112. UINT npasswordLen,
  113. ULONG nHelpContext );
  114. }; // class RESOURCE_PASSWORD_DIALOG
  115. #endif // _RESOURCE_PASSWORD_HXX