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.

68 lines
1.6 KiB

  1. //Copyright (c) 1997-2000 Microsoft Corporation
  2. #define CCH_MAX_STRING 256
  3. class CLookPreviewGlobals
  4. {
  5. public:
  6. CLookPreviewGlobals()
  7. {
  8. // We don't initialize stuff here because we rely
  9. // on some other global variables that are not yet initialized
  10. m_bInitialized = FALSE;
  11. }
  12. BOOL Initialize();
  13. TCHAR m_szActive[CCH_MAX_STRING];
  14. TCHAR m_szInactive[CCH_MAX_STRING];
  15. TCHAR m_szMinimized[CCH_MAX_STRING];
  16. TCHAR m_szIconTitle[CCH_MAX_STRING];
  17. TCHAR m_szNormal[CCH_MAX_STRING];
  18. TCHAR m_szDisabled[CCH_MAX_STRING];
  19. TCHAR m_szSelected[CCH_MAX_STRING];
  20. TCHAR m_szMsgBox[CCH_MAX_STRING];
  21. TCHAR m_szButton[CCH_MAX_STRING];
  22. // TCHAR m_szSmallCaption[40];
  23. TCHAR m_szWindowText[CCH_MAX_STRING];
  24. TCHAR m_szMsgBoxText[CCH_MAX_STRING];
  25. protected:
  26. static BOOL sm_bOneInstanceCreated; // This variable insures that only one instance of CLookPreviewGlobals is created
  27. BOOL m_bInitialized;
  28. };
  29. class CLookPrev
  30. {
  31. public:
  32. CLookPrev()
  33. {
  34. m_hwnd = NULL;
  35. m_hmenuSample = NULL;
  36. m_hbmLook = NULL; // bitmap for the appearance preview
  37. }
  38. HWND m_hwnd;
  39. // Static window proc
  40. static LRESULT CALLBACK LookPreviewWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  41. static CLookPreviewGlobals sm_Globals;
  42. protected:
  43. HMENU m_hmenuSample;
  44. HBITMAP m_hbmLook; // bitmap for the appearance preview
  45. void ShowBitmap(HDC hdc);
  46. void Draw(HDC hdc);
  47. protected: // Message handlers
  48. void OnCreate();
  49. void OnDestroy();
  50. void OnRepaint();
  51. void OnRecalc();
  52. void OnPaint(HDC hdc);
  53. };
  54. // Messages for the Look Preview window
  55. #define LPM_REPAINT WM_USER + 1
  56. #define LPM_RECALC WM_USER + 2