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.

78 lines
3.3 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: DimmedWindow.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class that implements the dimmed window when displaying logoff / shut down
  7. // dialog.
  8. //
  9. // History: 2000-05-18 vtan created
  10. // --------------------------------------------------------------------------
  11. #ifndef _DimmedWindow_
  12. #define _DimmedWindow_
  13. #include "unknwn.h"
  14. // --------------------------------------------------------------------------
  15. // CDimmedWindow::CDimmedWindow
  16. //
  17. // Purpose: Implements the dimmed window feature for the turn off dialog.
  18. //
  19. // History: 2000-05-17 vtan created
  20. // --------------------------------------------------------------------------
  21. class CDimmedWindow : public IUnknown
  22. {
  23. private:
  24. CDimmedWindow (void);
  25. CDimmedWindow (const CDimmedWindow& copyObject);
  26. const CDimmedWindow& operator = (const CDimmedWindow& assignObject);
  27. virtual ~CDimmedWindow (void);
  28. public:
  29. CDimmedWindow (HINSTANCE hInstance);
  30. public:
  31. // IUnknown methods
  32. virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID riid, void* *ppvObject);
  33. virtual ULONG STDMETHODCALLTYPE AddRef (void);
  34. virtual ULONG STDMETHODCALLTYPE Release (void);
  35. HWND Create (void);
  36. void SetupDim();
  37. BOOL StepDim();
  38. void Dither();
  39. private:
  40. int GetLowestScreenBitDepth (void) const;
  41. bool IsForcedDimScreen (void) const;
  42. bool IsDimScreen (void) const;
  43. static LRESULT CALLBACK WndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  44. private:
  45. LONG _lReferenceCount;
  46. const HINSTANCE _hInstance;
  47. ATOM _atom;
  48. HWND _hwnd;
  49. int _xVirtualScreen,
  50. _yVirtualScreen,
  51. _cxVirtualScreen,
  52. _cyVirtualScreen;
  53. bool _fDithered;
  54. HDC _hdcDimmed;
  55. HBITMAP _hbmOldDimmed;
  56. HBITMAP _hbmDimmed;
  57. void* _pvPixels;
  58. int _idxChunk;
  59. int _idxSaturation;
  60. private:
  61. static const TCHAR s_szWindowClassName[];
  62. static const TCHAR s_szExplorerKeyName[];
  63. static const TCHAR s_szExplorerPolicyKeyName[];
  64. static const TCHAR s_szForceDimValueName[];
  65. };
  66. #endif /* _DimmedWindow_ */