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.

92 lines
4.3 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. static const int MAGIC_NUMBER = 48517;
  35. private:
  36. CSwitchUserDialog (void);
  37. CSwitchUserDialog (const CSwitchUserDialog& copyObject);
  38. const CSwitchUserDialog& operator = (const CSwitchUserDialog& assignObject);
  39. public:
  40. CSwitchUserDialog (HINSTANCE hInstance);
  41. ~CSwitchUserDialog (void);
  42. DWORD Show (HWND hwndParent);
  43. private:
  44. void PaintBitmap (HDC hdcDestination, const RECT *prcDestination, HBITMAP hbmSource, const RECT *prcSource);
  45. void RemoveTooltip (void);
  46. void FilterMetaCharacters (TCHAR *pszText);
  47. void EndDialog (HWND hwnd, INT_PTR iResult);
  48. void Handle_BN_CLICKED (HWND hwnd, WORD wID);
  49. void Handle_WM_INITDIALOG (HWND hwnd);
  50. void Handle_WM_DESTROY (HWND hwnd);
  51. void Handle_WM_ERASEBKGND (HWND hwnd, HDC hdcErase);
  52. void Handle_WM_PRINTCLIENT (HWND hwnd, HDC hdcPrint, DWORD dwOptions);
  53. void Handle_WM_ACTIVATE (HWND hwnd, DWORD dwState);
  54. void Handle_WM_DRAWITEM (HWND hwnd, const DRAWITEMSTRUCT *pDIS);
  55. void Handle_WM_COMMAND (HWND hwnd, WPARAM wParam);
  56. void Handle_WM_MOUSEMOVE (HWND hwnd, UINT uiID);
  57. void Handle_WM_MOUSEHOVER (HWND hwnd, UINT uiID);
  58. void Handle_WM_MOUSELEAVE (HWND hwnd);
  59. static INT_PTR CALLBACK CB_DialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  60. static LRESULT CALLBACK ButtonSubClassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uiID, DWORD_PTR dwRefData);
  61. private:
  62. const HINSTANCE _hInstance;
  63. HBITMAP _hbmBackground;
  64. HBITMAP _hbmFlag;
  65. HBITMAP _hbmButtons;
  66. HFONT _hfntTitle;
  67. HFONT _hfntButton;
  68. HPALETTE _hpltShell;
  69. RECT _rcBackground;
  70. RECT _rcFlag;
  71. RECT _rcButtons;
  72. LONG _lButtonHeight;
  73. UINT _uiHoverID;
  74. UINT _uiFocusID;
  75. bool _fSuccessfulInitialization;
  76. bool _fDialogEnded;
  77. CTooltip* _pTooltip;
  78. };
  79. #endif /* __cplusplus */
  80. EXTERN_C DWORD SwitchUserDialog_Show (HWND hwndParent);
  81. #endif /* _SwitchUserDialog_ */