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.

81 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. return NULL;
  22. }
  23. //
  24. // convert the "base" of the monitor to the right color.
  25. //
  26. // the lower left of the bitmap has a transparent color
  27. // we fixup using FloodFill
  28. //
  29. hdc = CreateCompatibleDC(NULL);
  30. if (hdc)
  31. {
  32. hbmT = (HBITMAP) SelectObject(hdc, hbm);
  33. hbrT = (HBRUSH) SelectObject(hdc, GetSysColorBrush(COLOR_3DFACE));
  34. GetObject(hbm, sizeof(bm), &bm);
  35. ExtFloodFill(hdc, 0, bm.bmHeight-1, GetPixel(hdc, 0, bm.bmHeight-1), FLOODFILLSURFACE);
  36. // unless the caller would like to do it, we fill in the desktop here
  37. if( bFillDesktop )
  38. {
  39. SelectObject(hdc, GetSysColorBrush(COLOR_DESKTOP));
  40. ExtFloodFill(hdc, MON_X+1, MON_Y+1, GetPixel(hdc, MON_X+1, MON_Y+1), FLOODFILLSURFACE);
  41. }
  42. // clean up after ourselves
  43. SelectObject(hdc, hbrT);
  44. SelectObject(hdc, hbmT);
  45. DeleteDC(hdc);
  46. }
  47. return hbm;
  48. }
  49. BOOL CALLBACK _AddDisplayPropSheetPage(HPROPSHEETPAGE hpage, LPARAM lParam)
  50. {
  51. PROPSHEETHEADER FAR * ppsh = (PROPSHEETHEADER FAR *) lParam;
  52. if (ppsh)
  53. {
  54. if (hpage && (ppsh->nPages < MAX_PAGES))
  55. {
  56. ppsh->phpage[ppsh->nPages++] = hpage;
  57. return TRUE;
  58. }
  59. }
  60. return FALSE;
  61. }