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.

91 lines
4.4 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: SwitchUserDialog.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class that implements presentation of the Switch User dialog.
  7. //
  8. // History: 2001-01-23 vtan created (form Turn Off Dialog)
  9. // --------------------------------------------------------------------------
  10. #ifndef _SwitchUserDialog_
  11. #define _SwitchUserDialog_
  12. #ifdef __cplusplus
  13. #include "Tooltip.h"
  14. // --------------------------------------------------------------------------
  15. // CSwitchUserDialog::CSwitchUserDialog
  16. //
  17. // Purpose: Implements the "Switch User Dialog" feature.
  18. //
  19. // History: 2001-01-23 vtan created (form Turn Off Dialog)
  20. // --------------------------------------------------------------------------
  21. class CSwitchUserDialog
  22. {
  23. private:
  24. enum
  25. {
  26. BUTTON_STATE_REST = 0,
  27. BUTTON_STATE_DOWN,
  28. BUTTON_STATE_HOVER,
  29. BUTTON_STATE_MAX,
  30. BUTTON_GROUP_SWITCHUSER = 0,
  31. BUTTON_GROUP_LOGOFF,
  32. BUTTON_GROUP_MAX
  33. };
  34. private:
  35. CSwitchUserDialog (void);
  36. CSwitchUserDialog (const CSwitchUserDialog& copyObject);
  37. const CSwitchUserDialog& operator = (const CSwitchUserDialog& assignObject);
  38. public:
  39. CSwitchUserDialog (HINSTANCE hInstance);
  40. ~CSwitchUserDialog (void);
  41. DWORD Show (HWND hwndParent);
  42. private:
  43. void PaintBitmap (HDC hdcDestination, const RECT *prcDestination, HBITMAP hbmSource, const RECT *prcSource);
  44. void RemoveTooltip (void);
  45. void FilterMetaCharacters (TCHAR *pszText);
  46. void EndDialog (HWND hwnd, INT_PTR iResult);
  47. void Handle_BN_CLICKED (HWND hwnd, WORD wID);
  48. void Handle_WM_INITDIALOG (HWND hwnd);
  49. void Handle_WM_DESTROY (HWND hwnd);
  50. void Handle_WM_ERASEBKGND (HWND hwnd, HDC hdcErase);
  51. void Handle_WM_PRINTCLIENT (HWND hwnd, HDC hdcPrint, DWORD dwOptions);
  52. void Handle_WM_ACTIVATE (HWND hwnd, DWORD dwState);
  53. void Handle_WM_DRAWITEM (HWND hwnd, const DRAWITEMSTRUCT *pDIS);
  54. void Handle_WM_COMMAND (HWND hwnd, WPARAM wParam);
  55. void Handle_WM_MOUSEMOVE (HWND hwnd, UINT uiID);
  56. void Handle_WM_MOUSEHOVER (HWND hwnd, UINT uiID);
  57. void Handle_WM_MOUSELEAVE (HWND hwnd);
  58. static INT_PTR CALLBACK CB_DialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  59. static LRESULT CALLBACK ButtonSubClassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uiID, DWORD_PTR dwRefData);
  60. private:
  61. const HINSTANCE _hInstance;
  62. HBITMAP _hbmBackground;
  63. HBITMAP _hbmFlag;
  64. HBITMAP _hbmButtons;
  65. HFONT _hfntTitle;
  66. HFONT _hfntButton;
  67. HPALETTE _hpltShell;
  68. RECT _rcBackground;
  69. RECT _rcFlag;
  70. RECT _rcButtons;
  71. LONG _lButtonHeight;
  72. UINT _uiHoverID;
  73. UINT _uiFocusID;
  74. bool _fSuccessfulInitialization;
  75. bool _fDialogEnded;
  76. CTooltip* _pTooltip;
  77. };
  78. #endif /* __cplusplus */
  79. EXTERN_C DWORD SwitchUserDialog_Show (HWND hwndParent);
  80. #endif /* _SwitchUserDialog_ */