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.

82 lines
2.0 KiB

  1. #include "priv.h"
  2. static const TCHAR sc_szCoverClass[] = TEXT("DeskSaysNoPeekingItsASurprise");
  3. const TCHAR g_szNULL[] = TEXT("");
  4. int FmtMessageBox(HWND hwnd, UINT fuStyle, DWORD dwTitleID, DWORD dwTextID)
  5. {
  6. TCHAR Title[256];
  7. TCHAR Text[2000];
  8. LoadString(HINST_THISDLL, dwTextID, Text, ARRAYSIZE(Text));
  9. LoadString(HINST_THISDLL, dwTitleID, Title, ARRAYSIZE(Title));
  10. return (ShellMessageBox(HINST_THISDLL, hwnd, Text, Title, fuStyle));
  11. }
  12. HBITMAP FAR LoadMonitorBitmap( BOOL bFillDesktop )
  13. {
  14. HBITMAP hbm,hbmT;
  15. BITMAP bm;
  16. HBRUSH hbrT;
  17. HDC hdc;
  18. hbm = LoadBitmap(HINST_THISDLL, MAKEINTRESOURCE(IDB_MONITOR));
  19. if (hbm == NULL)
  20. {
  21. //Assert(0);
  22. return NULL;
  23. }
  24. //
  25. // convert the "base" of the monitor to the right color.
  26. //
  27. // the lower left of the bitmap has a transparent color
  28. // we fixup using FloodFill
  29. //
  30. hdc = CreateCompatibleDC(NULL);
  31. if (hdc)
  32. {
  33. hbmT = (HBITMAP) SelectObject(hdc, hbm);
  34. hbrT = (HBRUSH) SelectObject(hdc, GetSysColorBrush(COLOR_3DFACE));
  35. GetObject(hbm, sizeof(bm), &bm);
  36. ExtFloodFill(hdc, 0, bm.bmHeight-1, GetPixel(hdc, 0, bm.bmHeight-1), FLOODFILLSURFACE);
  37. // unless the caller would like to do it, we fill in the desktop here
  38. if( bFillDesktop )
  39. {
  40. SelectObject(hdc, GetSysColorBrush(COLOR_DESKTOP));
  41. ExtFloodFill(hdc, MON_X+1, MON_Y+1, GetPixel(hdc, MON_X+1, MON_Y+1), FLOODFILLSURFACE);
  42. }
  43. // clean up after ourselves
  44. SelectObject(hdc, hbrT);
  45. SelectObject(hdc, hbmT);
  46. DeleteDC(hdc);
  47. }
  48. return hbm;
  49. }
  50. BOOL CALLBACK _AddDisplayPropSheetPage(HPROPSHEETPAGE hpage, LPARAM lParam)
  51. {
  52. PROPSHEETHEADER FAR * ppsh = (PROPSHEETHEADER FAR *) lParam;
  53. if (ppsh)
  54. {
  55. if (hpage && (ppsh->nPages < MAX_PAGES))
  56. {
  57. ppsh->phpage[ppsh->nPages++] = hpage;
  58. return TRUE;
  59. }
  60. }
  61. return FALSE;
  62. }