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.

142 lines
4.1 KiB

  1. //Copyright (c) 1997-2000 Microsoft Corporation
  2. #ifdef ARRAYSIZE
  3. #undef ARRAYSIZE
  4. #endif
  5. #ifdef SIZEOF
  6. #undef SIZEOF
  7. #endif
  8. #define CCH_NONE 20 /* ARRAYSIZE( "(None)" ), big enough for German */
  9. #define CCH_CLOSE 20 /* ARRAYSIZE( "Close" ), big enough for German */
  10. #define CMSEC_COVER_WINDOW_TIMEOUT (15 * 1000) // 15 second timeout
  11. #define ID_CVRWND_TIMER 0x96F251CC // somewhat uniq id
  12. // information about the monitor bitmap
  13. // x, y, dx, dy define the size of the "screen" part of the bitmap
  14. // the RGB is the color of the screen's desktop
  15. // these numbers are VERY hard-coded to a monitor bitmap
  16. #define MON_X 16
  17. #define MON_Y 17
  18. #define MON_DX 152
  19. #define MON_DY 112
  20. #define MON_RGB RGB(0, 128, 128)
  21. #define MON_TRAY 8
  22. #define MIN_MINUTES 1
  23. #define MAX_MINUTES 60
  24. #define BUFFER_SIZE 400
  25. #define MAX_METHODS 100
  26. VOID RefreshColors (void);
  27. BOOL DeskInitCpl(void);
  28. void DeskShowPropSheet( HINSTANCE hInst, HWND hwndParent, LPCTSTR szCmdLine );
  29. BOOL APIENTRY BackgroundDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  30. BOOL APIENTRY ScreenSaverDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  31. BOOL APIENTRY AppearanceDlgProc( HWND hDlg, UINT message, UINT wParam, LONG lParam);
  32. BOOL CALLBACK DisplayPageProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
  33. BOOL FAR GetMonitorSettingsPage(LPPROPSHEETPAGE psp, int iDevice);
  34. BOOL APIENTRY DeskDefPropPageProc( HWND hDlg, UINT message, UINT wParam, LONG lParam);
  35. LONG WINAPI MyStrToLong(LPCTSTR sz);
  36. // background previewer includes
  37. #define DIBERR_SUCCESS 1 // successful open
  38. #define DIBERR_NOOPEN -1 // file could not be opened
  39. #define DIBERR_INVALID -2 // file is not a valid bitmap
  40. #define BP_NEWPAT 0x01 // pattern changed
  41. #define BP_NEWWALL 0x02 // wallpaper changed
  42. #define BP_TILE 0x04 // tile the wallpaper (center otherwise)
  43. #define BP_REINIT 0x08 // reload the image (system colors changed)
  44. #define WM_SETBACKINFO (WM_USER + 1)
  45. #define BACKPREV_CLASS TEXT("BackgroundPreview")
  46. #define LOOKPREV_CLASS TEXT("LookPreview")
  47. BOOL FAR PASCAL RegisterBackPreviewClass(HINSTANCE hInst);
  48. BOOL FAR PASCAL RegisterLookPreviewClass(HINSTANCE hInst);
  49. HBITMAP FAR LoadMonitorBitmap( BOOL bFillDesktop );
  50. #ifdef UNICODE
  51. UINT WinExecN( LPCTSTR lpCmdLine, UINT uCmdShow );
  52. #else
  53. // If we're on Win95, then just use the ANSI-only WinExec instead of
  54. // rolling our own
  55. # define WinExecN WinExec
  56. #endif
  57. #define SETTINGSPAGE_DEFAULT -1
  58. #define SETTINGSPAGE_FALLBACK 0
  59. #define Assert(p) /* nothing */
  60. #define ARRAYSIZE( a ) (sizeof(a) / sizeof(a[0]))
  61. #define SIZEOF( a ) sizeof(a)
  62. //
  63. // CreateCoverWindow
  64. //
  65. // creates a window which obscures the display
  66. // flags:
  67. // 0 means erase to black
  68. // COVER_NOPAINT means "freeze" the display
  69. //
  70. // just post it a WM_CLOSE when you're done with it
  71. //
  72. #define COVER_NOPAINT (0x1)
  73. //
  74. HWND FAR PASCAL CreateCoverWindow( DWORD flags );
  75. //
  76. //
  77. // Macro to replace MAKEPOINT() since points now have 32 bit x & y
  78. //
  79. #define LPARAM2POINT( lp, ppt ) \
  80. ((ppt)->x = LOWORD(lp), (ppt)->y = HIWORD(lp))
  81. //
  82. // Globals
  83. //
  84. extern TCHAR g_szNULL[];
  85. extern TCHAR g_szNone[CCH_NONE];
  86. extern TCHAR g_szClose[CCH_CLOSE];
  87. extern TCHAR g_szControlIni[];
  88. extern TCHAR g_szPatterns[];
  89. extern TCHAR g_szCurPattern[]; // name of currently selected pattern
  90. extern TCHAR g_szCurWallpaper[]; // name of currently selected wallpaper
  91. extern BOOL g_bValidBitmap; // whether or not wallpaper is valid
  92. extern TCHAR g_szBoot[];
  93. extern TCHAR g_szSystemIni[];
  94. extern TCHAR g_szWindows[];
  95. extern HDC g_hdcMem;
  96. #if 0
  97. # pragma message(__FILE__"(134): warning : remove debug code before checkin")
  98. # define DBG_PRINT
  99. # define DPRINT(s) OutputDebugString(TEXT(s) TEXT("\n"))
  100. # define DPRINTF(p) if(1){TCHAR szdbuf[256]; wsprintf p; OutputDebugString(szdbuf);}else
  101. # ifdef DM_TRACE
  102. # undef DM_TRACE
  103. # endif
  104. # define DM_TRACE szdbuf
  105. #else
  106. // Remove all the DPRINTS once we have debugged USER
  107. # define DPRINT(s)
  108. # define DPRINTF(p)
  109. #endif