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.

1685 lines
62 KiB

  1. #include "stdafx.h"
  2. #include "log.h"
  3. #include "browsedi.h"
  4. #include "dllmain.h"
  5. #include "ocpages.h"
  6. #pragma hdrstop
  7. #ifndef ENABLE_OC_PAGES
  8. // there are no globals here
  9. #else
  10. // OcManage globals
  11. extern OCMANAGER_ROUTINES gHelperRoutines;
  12. // Globals for us
  13. HWND g_hParentSheet = NULL;
  14. BOOL g_bFTP, g_bWWW;
  15. HWND g_hFTPEdit, g_hWWWEdit;
  16. #endif
  17. #ifndef ENABLE_OC_PAGES //ENABLE_OC_PAGES
  18. DWORD_PTR OC_REQUEST_PAGES_Func(IN LPCTSTR ComponentId,IN LPCTSTR SubcomponentId,IN UINT Function,IN UINT_PTR Param1,IN OUT PVOID Param2)
  19. {
  20. DWORD_PTR dwOcEntryReturn = 0;
  21. WizardPagesType PageType;
  22. PSETUP_REQUEST_PAGES pSetupRequestPages = NULL;
  23. UINT MaxPages;
  24. HPROPSHEETPAGE pPage;
  25. PageType = (WizardPagesType)Param1;
  26. dwOcEntryReturn = 0;
  27. //OC_REQUEST_PAGES_Func_Exit:
  28. TCHAR szPageType_Desc[30] = _T("");
  29. if (PageType == 0) {_tcscpy(szPageType_Desc, _T("WizPagesWelcome"));}
  30. if (PageType == 1) {_tcscpy(szPageType_Desc, _T("WizPagesMode"));}
  31. if (PageType == 2) {_tcscpy(szPageType_Desc, _T("WizPagesEarly"));}
  32. if (PageType == 3) {_tcscpy(szPageType_Desc, _T("WizPagesPrenet"));}
  33. if (PageType == 4) {_tcscpy(szPageType_Desc, _T("WizPagesPostnet"));}
  34. if (PageType == 5) {_tcscpy(szPageType_Desc, _T("WizPagesLate"));}
  35. if (PageType == 6) {_tcscpy(szPageType_Desc, _T("WizPagesFinal"));}
  36. if (PageType == 7) {_tcscpy(szPageType_Desc, _T("WizPagesTypeMax"));}
  37. iisDebugOut((LOG_TYPE_PROGRAM_FLOW, _T("[%s,%s] End. PageType=%d (%s) Return=%d RegisteredPages\n"), ComponentId, SubcomponentId, PageType, szPageType_Desc, dwOcEntryReturn));
  38. return dwOcEntryReturn;
  39. }
  40. #else //ENABLE_OC_PAGES
  41. DWORD_PTR OC_REQUEST_PAGES_Func(IN LPCTSTR ComponentId,IN LPCTSTR SubcomponentId,IN UINT Function,IN UINT_PTR Param1,IN OUT PVOID Param2)
  42. {
  43. DWORD_PTR dwOcEntryReturn = 0;
  44. WizardPagesType PageType;
  45. PSETUP_REQUEST_PAGES pSetupRequestPages = NULL;
  46. UINT MaxPages;
  47. HPROPSHEETPAGE pPage;
  48. PageType = (WizardPagesType)Param1;
  49. if ( PageType == WizPagesWelcome )
  50. {
  51. // No Welcome page if installing on NT5
  52. if (g_pTheApp->m_fInvokedByNT)
  53. {
  54. dwOcEntryReturn = 0;
  55. //OC_REQUEST_PAGES_Func_Exit:
  56. }
  57. else
  58. {
  59. pSetupRequestPages = (PSETUP_REQUEST_PAGES)Param2;
  60. MaxPages = pSetupRequestPages->MaxPages;
  61. pPage = CreatePage(IDD_PROPPAGE_WELCOME, pWelcomePageDlgProc);
  62. pSetupRequestPages->MaxPages = 1;
  63. pSetupRequestPages->Pages[0] = pPage;
  64. dwOcEntryReturn = 1;
  65. }
  66. goto OC_REQUEST_PAGES_Func_Exit;
  67. }
  68. if ( PageType == WizPagesMode )
  69. {
  70. pSetupRequestPages = (PSETUP_REQUEST_PAGES)Param2;
  71. MaxPages = pSetupRequestPages->MaxPages;
  72. switch (g_pTheApp->m_eInstallMode)
  73. {
  74. case IM_UPGRADE:
  75. // No Eula page if installing on NT5
  76. if (g_pTheApp->m_fInvokedByNT)
  77. {
  78. // Don't show any pages
  79. g_pTheApp->m_fEULA = TRUE;
  80. // Set to upgrade only -- (not upgrade and add extra components afterwards)
  81. //SetIISSetupMode(SETUPMODE_UPGRADEONLY);
  82. dwOcEntryReturn = 0;
  83. pSetupRequestPages->MaxPages = 0;
  84. }
  85. else
  86. {
  87. pPage = CreatePage(IDD_PROPPAGE_EULA, pEULAPageDlgProc);
  88. pSetupRequestPages->Pages[0] = pPage;
  89. pPage = CreatePage(IDD_PROPPAGE_MODE_UPGRADE, pUpgradePageDlgProc);
  90. pSetupRequestPages->Pages[1] = pPage;
  91. pSetupRequestPages->MaxPages = 2;
  92. dwOcEntryReturn = pSetupRequestPages->MaxPages;
  93. }
  94. break;
  95. case IM_MAINTENANCE:
  96. if (g_pTheApp->m_fInvokedByNT)
  97. {
  98. // Don't show any pages
  99. g_pTheApp->m_bRefreshSettings = TRUE;
  100. dwOcEntryReturn = 0;
  101. pSetupRequestPages->MaxPages = 0;
  102. }
  103. else
  104. {
  105. pPage = CreatePage(IDD_PROPPAGE_MODE_MAINTENANCE, pMaintenancePageDlgProc);
  106. pSetupRequestPages->Pages[0] = pPage;
  107. pPage = CreatePage(IDD_PROPPAGE_SRC_PATH, pSrcPathPageDlgProc);
  108. pSetupRequestPages->Pages[1] = pPage;
  109. pSetupRequestPages->MaxPages = 2;
  110. dwOcEntryReturn = pSetupRequestPages->MaxPages;
  111. }
  112. break;
  113. case IM_FRESH:
  114. // No Eula page if installing on NT5
  115. if (g_pTheApp->m_fInvokedByNT)
  116. {
  117. // Don't show any pages
  118. // just proceed with installation
  119. g_pTheApp->m_fEULA = TRUE;
  120. dwOcEntryReturn = 0;
  121. pSetupRequestPages->MaxPages = 0;
  122. }
  123. else
  124. {
  125. pPage = CreatePage(IDD_PROPPAGE_EULA, pEULAPageDlgProc);
  126. pSetupRequestPages->Pages[0] = pPage;
  127. pPage = CreatePage(IDD_PROPPAGE_MODE_FRESH, pFreshPageDlgProc);
  128. pSetupRequestPages->Pages[1] = pPage;
  129. pSetupRequestPages->MaxPages = 2;
  130. dwOcEntryReturn = pSetupRequestPages->MaxPages;
  131. }
  132. break;
  133. default:
  134. iisDebugOut((LOG_TYPE_TRACE, _T("Should never reach this branch: IM_DEGRADE.\n")));
  135. pSetupRequestPages->MaxPages = 0;
  136. break;
  137. }
  138. dwOcEntryReturn = pSetupRequestPages->MaxPages;
  139. goto OC_REQUEST_PAGES_Func_Exit;
  140. }
  141. if ( PageType == WizPagesEarly )
  142. {
  143. pSetupRequestPages = (PSETUP_REQUEST_PAGES)Param2;
  144. MaxPages = pSetupRequestPages->MaxPages;
  145. pPage = CreatePage(IDD_PROPPAGE_PUBLISH_DIR, pEarlyPageDlgProc);
  146. pSetupRequestPages->MaxPages = 1;
  147. pSetupRequestPages->Pages[0] = pPage;
  148. dwOcEntryReturn = 1;
  149. goto OC_REQUEST_PAGES_Func_Exit;
  150. }
  151. if ( PageType == WizPagesFinal )
  152. {
  153. // No Final page if invoked by NT
  154. if (g_pTheApp->m_fInvokedByNT)
  155. {
  156. pSetupRequestPages = (PSETUP_REQUEST_PAGES)Param2;
  157. // Don't show any pages just proceed with installation
  158. dwOcEntryReturn = 0;
  159. pSetupRequestPages->MaxPages = 0;
  160. }
  161. else
  162. {
  163. pSetupRequestPages = (PSETUP_REQUEST_PAGES)Param2;
  164. MaxPages = pSetupRequestPages->MaxPages;
  165. pPage = CreatePage(IDD_PROPPAGE_END, pEndPageDlgProc);
  166. pSetupRequestPages->MaxPages = 1;
  167. pSetupRequestPages->Pages[0] = pPage;
  168. dwOcEntryReturn = 1;
  169. }
  170. goto OC_REQUEST_PAGES_Func_Exit;
  171. }
  172. OC_REQUEST_PAGES_Func_Exit:
  173. TCHAR szPageType_Desc[30] = _T("");
  174. if (PageType == 0) {_tcscpy(szPageType_Desc, _T("WizPagesWelcome"));}
  175. if (PageType == 1) {_tcscpy(szPageType_Desc, _T("WizPagesMode"));}
  176. if (PageType == 2) {_tcscpy(szPageType_Desc, _T("WizPagesEarly"));}
  177. if (PageType == 3) {_tcscpy(szPageType_Desc, _T("WizPagesPrenet"));}
  178. if (PageType == 4) {_tcscpy(szPageType_Desc, _T("WizPagesPostnet"));}
  179. if (PageType == 5) {_tcscpy(szPageType_Desc, _T("WizPagesLate"));}
  180. if (PageType == 6) {_tcscpy(szPageType_Desc, _T("WizPagesFinal"));}
  181. if (PageType == 7) {_tcscpy(szPageType_Desc, _T("WizPagesTypeMax"));}
  182. iisDebugOut((LOG_TYPE_PROGRAM_FLOW, _T("[%s,%s] End. PageType=%d (%s) Return=%d RegisteredPages\n"), ComponentId, SubcomponentId, PageType, szPageType_Desc, dwOcEntryReturn));
  183. return dwOcEntryReturn;
  184. }
  185. HPROPSHEETPAGE CreatePage(int nID, DLGPROC pDlgProc)
  186. {
  187. PROPSHEETPAGE Page;
  188. HPROPSHEETPAGE PageHandle = NULL;
  189. Page.dwSize = sizeof(PROPSHEETPAGE);
  190. Page.dwFlags = PSP_DEFAULT;
  191. Page.hInstance = (HINSTANCE)g_MyModuleHandle;
  192. Page.pszTemplate = MAKEINTRESOURCE(nID);
  193. Page.pfnDlgProc = pDlgProc;
  194. iisDebugOut_Start(_T("comdlg32:CreatePropertySheetPage()"));
  195. PageHandle = CreatePropertySheetPage(&Page);
  196. iisDebugOut_End(_T("comdlg32:CreatePropertySheetPage()"));
  197. return(PageHandle);
  198. }
  199. HPALETTE CreateDIBPalette (LPBITMAPINFO lpbmi, LPINT lpiNumColors)
  200. {
  201. LPBITMAPINFOHEADER lpbi;
  202. LPLOGPALETTE lpPal;
  203. HANDLE hLogPal = NULL;
  204. HPALETTE hPal = NULL;
  205. int i;
  206. lpbi = (LPBITMAPINFOHEADER)lpbmi;
  207. if (lpbi->biBitCount <= 8)
  208. {*lpiNumColors = (1 << lpbi->biBitCount);}
  209. else
  210. {*lpiNumColors = 0;} // No palette needed for 24 BPP DIB
  211. if (lpbi->biClrUsed > 0)
  212. {*lpiNumColors = lpbi->biClrUsed;} // Use biClrUsed
  213. if (*lpiNumColors)
  214. {
  215. hLogPal = GlobalAlloc (GHND, sizeof (LOGPALETTE) + sizeof (PALETTEENTRY) * (*lpiNumColors));
  216. if (hLogPal)
  217. {
  218. lpPal = (LPLOGPALETTE) GlobalLock (hLogPal);
  219. lpPal->palVersion = 0x300;
  220. lpPal->palNumEntries = (WORD)*lpiNumColors;
  221. for (i = 0; i < *lpiNumColors; i++)
  222. {
  223. lpPal->palPalEntry[i].peRed = lpbmi->bmiColors[i].rgbRed;
  224. lpPal->palPalEntry[i].peGreen = lpbmi->bmiColors[i].rgbGreen;
  225. lpPal->palPalEntry[i].peBlue = lpbmi->bmiColors[i].rgbBlue;
  226. lpPal->palPalEntry[i].peFlags = 0;
  227. }
  228. hPal = CreatePalette (lpPal);
  229. GlobalUnlock (hLogPal);
  230. GlobalFree (hLogPal);
  231. }
  232. }
  233. return hPal;
  234. }
  235. HBITMAP LoadResourceBitmap(HINSTANCE hInstance, LPCTSTR lpString, HPALETTE FAR* lphPalette)
  236. {
  237. HRSRC hRsrc = NULL;
  238. HGLOBAL hGlobal = NULL;
  239. HBITMAP hBitmapFinal = NULL;
  240. LPBITMAPINFOHEADER lpbi = NULL;
  241. HDC hdc;
  242. int iNumColors;
  243. if (hRsrc = FindResource(hInstance, lpString, RT_BITMAP))
  244. {
  245. hGlobal = LoadResource(hInstance, hRsrc);
  246. if (hGlobal)
  247. {
  248. lpbi = (LPBITMAPINFOHEADER)LockResource(hGlobal);
  249. if (lpbi)
  250. {
  251. hdc = GetDC(NULL);
  252. if (hdc)
  253. {
  254. *lphPalette = CreateDIBPalette ((LPBITMAPINFO)lpbi, &iNumColors);
  255. if (*lphPalette)
  256. {
  257. SelectPalette(hdc,*lphPalette,FALSE);
  258. RealizePalette(hdc);
  259. }
  260. hBitmapFinal = CreateDIBitmap(hdc,(LPBITMAPINFOHEADER)lpbi,(LONG)CBM_INIT,(LPSTR)lpbi + lpbi->biSize + iNumColors * sizeof(RGBQUAD),(LPBITMAPINFO)lpbi,DIB_RGB_COLORS );
  261. ReleaseDC(NULL,hdc);
  262. }
  263. UnlockResource(hGlobal);
  264. }
  265. FreeResource(hGlobal);
  266. }
  267. }
  268. return (hBitmapFinal);
  269. }
  270. //----------------------------------------------------------------------------
  271. void PaintTextInRect( HDC hdc, LPCTSTR psz, RECT* pRect, COLORREF color,LONG lfHeight, LONG lfWeight, BYTE lfPitchAndFamily )
  272. {
  273. HFONT hfontOld = NULL;
  274. // create the font we will use for this
  275. HFONT hfontDraw = CreateFont(
  276. lfHeight, // logical height of font
  277. 0, // logical average character width
  278. 0, // angle of escapement
  279. 0, // base-line orientation angle
  280. lfWeight, // font weight
  281. FALSE, // italic attribute flag
  282. FALSE, // underline attribute flag
  283. FALSE, // strikeout attribute flag
  284. DEFAULT_CHARSET, // character set identifier
  285. OUT_DEFAULT_PRECIS, // output precision
  286. CLIP_DEFAULT_PRECIS,// clipping precision
  287. DEFAULT_QUALITY, // output quality
  288. lfPitchAndFamily, // pitch and family
  289. NULL // pointer to typeface name string
  290. );
  291. if (hfontDraw)
  292. {
  293. // set the font into place
  294. hfontOld = (HFONT)SelectObject( hdc, hfontDraw );
  295. }
  296. // prevent the character box from being erased
  297. int oldBkMode = SetBkMode(hdc, TRANSPARENT);
  298. // set the text color
  299. COLORREF oldTextColor = SetTextColor( hdc, color );
  300. // draw the text
  301. DrawText(
  302. hdc, // handle to device context
  303. psz, // pointer to string to draw
  304. -1, // string length, in characters
  305. pRect, // pointer to structure with formatting dimensions
  306. DT_LEFT|DT_TOP // text-drawing flags
  307. );
  308. // restore hdc settings
  309. SetBkMode( hdc, oldBkMode );
  310. SetTextColor( hdc, oldTextColor );
  311. if (hfontDraw)
  312. {
  313. SelectObject( hdc, hfontOld );
  314. // clean up the font
  315. DeleteObject( hfontDraw );
  316. }
  317. }
  318. //----------------------------------------------------------------------------
  319. // this routine gets the rect from the frame and calls PaintTextInRect
  320. void PaintTextInFrame( HDC hdc, LPCTSTR psz, HWND hDlg, UINT nID, COLORREF color,LONG lfHeight, LONG lfWeight, BYTE lfPitchAndFamily )
  321. {
  322. RECT rect;
  323. GetWindowRect( GetDlgItem(hDlg, nID), &rect );
  324. MapWindowPoints( HWND_DESKTOP, hDlg, (LPPOINT)&rect, 2 );
  325. PaintTextInRect( hdc, psz, &rect, color, lfHeight, lfWeight, lfPitchAndFamily );
  326. }
  327. void OnPaintBitmap(HWND hdlg, HDC hdc, int n, RECT *hRect)
  328. {
  329. HBITMAP hBitmap,hOldBitmap;
  330. HPALETTE hPalette;
  331. HDC hMemDC;
  332. BITMAP bm;
  333. int nID;
  334. // n:
  335. // 0 = welcome page
  336. // 1 = all other pages
  337. // 2 = IIS "input path's page"
  338. // Load the bitmap resource
  339. /*
  340. if (n == 0){nID = IDB_WELCOMES;}
  341. else{nID = IDB_BANNERS;}
  342. hBitmap = LoadResourceBitmap(g_MyModuleHandle, MAKEINTRESOURCE(nID), &hPalette);
  343. GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
  344. hMemDC = CreateCompatibleDC(hdc);
  345. SelectPalette(hdc,hPalette,FALSE);
  346. RealizePalette(hdc);
  347. SelectPalette(hMemDC,hPalette,FALSE);
  348. RealizePalette(hMemDC);
  349. hOldBitmap = (HBITMAP)SelectObject(hMemDC,hBitmap);
  350. StretchBlt( hdc, 0, 0, hRect->right, hRect->bottom, hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY );
  351. DeleteObject(SelectObject(hMemDC,hOldBitmap));
  352. DeleteDC(hMemDC);
  353. DeleteObject(hPalette);
  354. */
  355. CString csMS, csTitle;
  356. if (n==0)
  357. {
  358. if (g_pTheApp->m_eOS == OS_W95)
  359. {
  360. // On the welcome page, show "Microsoft(R)"
  361. MyLoadString(IDS_BITMAP_MS_TRADEMARK_OTHER, csMS);
  362. }
  363. else
  364. {
  365. // On the welcome page, show "Microsoft�"
  366. MyLoadString(IDS_BITMAP_MS_TRADEMARK, csMS);
  367. }
  368. }
  369. else
  370. {
  371. // no trademark on other pages
  372. MyLoadString(IDS_BITMAP_MS, csMS);
  373. }
  374. // If were on the (2 = IIS "input path's page") then
  375. // make sure the banner is says "IIS", or "PWS" not "NT Option Pack"
  376. if (n==2)
  377. {
  378. MyLoadString(IDS_BITMAP_TITLE, csTitle);
  379. }
  380. else
  381. {
  382. if (g_pTheApp->m_eNTOSType == OT_NTW)
  383. {
  384. if (n == 0)
  385. {
  386. // on the welcome page make sure to show the "NT(R)" one
  387. // Only applies to NT and should only be shown the first time you see "NT".
  388. MyLoadString(IDS_BITMAP_TITLE_TRADEMARK, csTitle);
  389. }
  390. else
  391. {
  392. MyLoadString(IDS_BITMAP_TITLE, csTitle);
  393. }
  394. }
  395. else
  396. {
  397. if (n == 0)
  398. {
  399. // on the welcome page make sure to show the "NT(R)" one
  400. // Only applies to NT and should only be shown the first time you see "NT".
  401. MyLoadString(IDS_BITMAP_TITLE_TRADEMARK, csTitle);
  402. }
  403. else
  404. {
  405. MyLoadString(IDS_BITMAP_TITLE, csTitle);
  406. }
  407. }
  408. }
  409. if (n==0)
  410. {
  411. // On the welcome page
  412. CString csIntro, csFeature;
  413. if (g_pTheApp->m_eOS == OS_W95)
  414. {
  415. MyLoadString(IDS_WELCOMEC_INTRO, csIntro);
  416. MyLoadString(IDS_WELCOMEC_FEATURE, csFeature);
  417. }
  418. else if (g_pTheApp->m_eNTOSType == OT_NTW)
  419. {
  420. MyLoadString(IDS_WELCOMEW_INTRO, csIntro);
  421. MyLoadString(IDS_WELCOMEW_FEATURE, csFeature);
  422. }
  423. else
  424. {
  425. MyLoadString(IDS_WELCOMES_INTRO, csIntro);
  426. MyLoadString(IDS_WELCOMES_FEATURE, csFeature);
  427. }
  428. PaintTextInFrame(hdc, csMS, hdlg, IDC_FRAME_WELCOME_MS, 0x0, 16, FW_NORMAL, DEFAULT_PITCH | FF_DONTCARE);
  429. PaintTextInFrame(hdc, csTitle, hdlg, IDC_FRAME_WELCOME_TITLE, 0x0, 24, FW_HEAVY, DEFAULT_PITCH | FF_DONTCARE);
  430. PaintTextInFrame(hdc, csIntro, hdlg, IDC_FRAME_WELCOME_INTRO, 0x0, 14, FW_NORMAL, DEFAULT_PITCH | FF_DONTCARE);
  431. PaintTextInFrame(hdc, csFeature, hdlg, IDC_FRAME_WELCOME_FEATURE, 0x0, 14, FW_NORMAL, DEFAULT_PITCH | FF_DONTCARE);
  432. }
  433. else
  434. {
  435. PaintTextInFrame(hdc, csMS, hdlg, IDC_FRAME_BANNER_MS, 0x0, 16, FW_NORMAL, DEFAULT_PITCH | FF_DONTCARE);
  436. PaintTextInFrame(hdc, csTitle, hdlg, IDC_FRAME_BANNER_TITLE, 0x0, 24, FW_HEAVY, DEFAULT_PITCH | FF_DONTCARE);
  437. }
  438. return;
  439. }
  440. INT_PTR CALLBACK pWelcomePageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  441. {
  442. INT_PTR bReturn = TRUE;
  443. LPNMHDR pnmh;
  444. HWND hSheet = NULL;
  445. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pWelcomePageDlgProc:"));
  446. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  447. switch(msg)
  448. {
  449. case WM_NOTIFY:
  450. pnmh = (LPNMHDR)lParam;
  451. switch (pnmh->code)
  452. {
  453. case PSN_SETACTIVE:
  454. // don't set on nt5
  455. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  456. if (g_pTheApp->m_fUnattended)
  457. {
  458. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  459. }
  460. else
  461. {
  462. iisDebugOut_Start(_T("pWelcomePageDlgProc()"));
  463. hSheet = GetParent(hdlg);
  464. g_hParentSheet = hSheet;
  465. PropSheet_SetWizButtons(hSheet, PSWIZB_NEXT);
  466. }
  467. break;
  468. default:
  469. break;
  470. }
  471. break;
  472. case WM_PAINT:
  473. {
  474. HDC hdc = NULL;
  475. PAINTSTRUCT ps;
  476. RECT rect;
  477. HWND hFrame = NULL;
  478. hdc = BeginPaint(hdlg, &ps);
  479. if (hdc)
  480. {
  481. hFrame = GetDlgItem(hdlg, IDC_FRAME_WELCOME);
  482. if (hFrame)
  483. {
  484. GetClientRect(hFrame, &rect);
  485. OnPaintBitmap(hdlg, hdc, 0, &rect);
  486. }
  487. EndPaint(hdlg, &ps);
  488. }
  489. }
  490. break;
  491. default:
  492. bReturn = FALSE;
  493. break;
  494. }
  495. return(bReturn);
  496. }
  497. BOOL InsertEULAText(HWND hEdit)
  498. {
  499. BOOL fReturn = FALSE;
  500. CString csFile = g_pTheApp->m_csPathSource + _T("\\license.txt");
  501. HANDLE hFile = CreateFile(csFile, GENERIC_READ, 0, NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, NULL);
  502. if (hFile != INVALID_HANDLE_VALUE)
  503. {
  504. DWORD dwSize = GetFileSize(hFile, NULL);
  505. BYTE *chBuffer = (BYTE *)HeapAlloc(GetProcessHeap(), 0, dwSize+1 );
  506. if (chBuffer)
  507. {
  508. ReadFile(hFile, chBuffer, dwSize, &dwSize, NULL);
  509. chBuffer[dwSize] = '\0';
  510. SendMessage (hEdit, EM_SETSEL, (WPARAM)0, (LPARAM)-1);
  511. SendMessageA(hEdit, EM_REPLACESEL, 0, (LPARAM)chBuffer);
  512. SendMessage (hEdit, EM_SETSEL, (WPARAM)-1, (LPARAM)0);
  513. HeapFree(GetProcessHeap(), 0, chBuffer);
  514. fReturn = TRUE;
  515. }
  516. CloseHandle(hFile);
  517. }
  518. return fReturn;
  519. }
  520. INT_PTR CALLBACK pEULAPageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  521. {
  522. INT_PTR bReturn = TRUE;
  523. LPNMHDR pnmh;
  524. HWND hSheet = NULL, hNext = NULL;
  525. HWND hEULAText = NULL;
  526. HWND hEULAAccept = NULL, hEULADecline = NULL;
  527. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pEULAPageDlgProc:"));
  528. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  529. switch(msg)
  530. {
  531. case WM_COMMAND:
  532. if (HIWORD(wParam) == BN_CLICKED)
  533. {
  534. hSheet = GetParent(hdlg);
  535. switch (LOWORD(wParam))
  536. {
  537. case IDC_EULA_ACCEPT:
  538. g_pTheApp->m_fEULA = TRUE;
  539. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  540. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto mode page
  541. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  542. return TRUE;
  543. case IDC_EULA_DECLINE:
  544. {
  545. // cancel setup
  546. MyMessageBox(NULL, IDS_EULA_DECLINED, MB_OK | MB_SETFOREGROUND);
  547. PropSheet_PressButton(hSheet, PSBTN_CANCEL);
  548. }
  549. return TRUE;
  550. default:
  551. break;
  552. }
  553. }
  554. if (HIWORD(wParam) == EN_SETFOCUS)
  555. {
  556. hEULAText = GetDlgItem(hdlg, IDC_LICENSE_TEXT);
  557. SendMessage (hEULAText, EM_SETSEL, (WPARAM)-1, (LPARAM)0);
  558. }
  559. break;
  560. case WM_NOTIFY:
  561. pnmh = (LPNMHDR)lParam;
  562. hSheet = GetParent(hdlg);
  563. switch (pnmh->code)
  564. {
  565. case PSN_SETACTIVE:
  566. // don't set on nt5
  567. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  568. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  569. if (g_pTheApp->m_fUnattended || g_pTheApp->m_fEULA)
  570. {
  571. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  572. }
  573. else
  574. {
  575. hEULAText = GetDlgItem(hdlg, IDC_LICENSE_TEXT);
  576. if (!InsertEULAText(hEULAText))
  577. {
  578. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  579. }
  580. else
  581. {
  582. hEULAAccept = GetDlgItem(hdlg, IDC_EULA_ACCEPT);
  583. hEULADecline = GetDlgItem(hdlg, IDC_EULA_DECLINE);
  584. EnableWindow(hEULAAccept, TRUE);
  585. EnableWindow(hEULADecline, TRUE);
  586. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK);
  587. }
  588. }
  589. break;
  590. default:
  591. break;
  592. }
  593. break;
  594. case WM_PAINT:
  595. {
  596. HDC hdc = NULL;
  597. PAINTSTRUCT ps;
  598. RECT rect;
  599. HWND hFrame = NULL;
  600. hdc = BeginPaint(hdlg, &ps);
  601. if (hdc)
  602. {
  603. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  604. if (hFrame)
  605. {
  606. GetClientRect(hFrame, &rect);
  607. OnPaintBitmap(hdlg, hdc, 1, &rect);
  608. }
  609. EndPaint(hdlg, &ps);
  610. }
  611. }
  612. break;
  613. default:
  614. bReturn = FALSE;
  615. break;
  616. }
  617. return(bReturn);
  618. }
  619. INT_PTR CALLBACK pFreshPageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  620. {
  621. INT_PTR bReturn = TRUE;
  622. LPNMHDR pnmh;
  623. HWND hSheet = GetParent(hdlg);
  624. HWND hMinimum = NULL, hTypical = NULL, hCustom = NULL;
  625. HWND hMinimumBox = NULL, hTypicalBox = NULL, hCustomBox = NULL;
  626. CString csMinimumString, csTypicalString, csCustomString;
  627. _tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pFreshPageDlgProc:"));
  628. _tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  629. SetIISSetupMode(SETUPMODE_CUSTOM);
  630. switch(msg)
  631. {
  632. case WM_NOTIFY:
  633. pnmh = (LPNMHDR)lParam;
  634. switch (pnmh->code)
  635. {
  636. case PSN_SETACTIVE:
  637. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  638. break;
  639. default:
  640. break;
  641. }
  642. break;
  643. case WM_PAINT:
  644. {
  645. HDC hdc = NULL;
  646. PAINTSTRUCT ps;
  647. RECT rect;
  648. HWND hFrame = NULL;
  649. hdc = BeginPaint(hdlg, &ps);
  650. if (hdc)
  651. {
  652. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  653. if (hFrame)
  654. {
  655. GetClientRect(hFrame, &rect);
  656. OnPaintBitmap(hdlg, hdc, 1, &rect);
  657. }
  658. EndPaint(hdlg, &ps);
  659. }
  660. }
  661. break;
  662. default:
  663. bReturn = FALSE;
  664. break;
  665. }
  666. return(bReturn);
  667. }
  668. /*
  669. // old code used when we had the fresh page.
  670. // kept around in this comment block just in case we need it in the future.
  671. #define WM_FINISH_INIT (WM_USER + 5000)
  672. INT_PTR CALLBACK pFreshPageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  673. {
  674. INT_PTR bReturn = TRUE;
  675. LPNMHDR pnmh;
  676. HWND hSheet = GetParent(hdlg);
  677. HWND hMinimum = NULL, hTypical = NULL, hCustom = NULL;
  678. HWND hMinimumBox = NULL, hTypicalBox = NULL, hCustomBox = NULL;
  679. CString csMinimumString, csTypicalString, csCustomString;
  680. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pFreshPageDlgProc:"));
  681. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  682. switch(msg)
  683. {
  684. case WM_INITDIALOG:
  685. hMinimum = GetDlgItem(hdlg, IDC_MINIMUM);
  686. hTypical = GetDlgItem(hdlg, IDC_TYPICAL);
  687. hCustom = GetDlgItem(hdlg, IDC_CUSTOM);
  688. hMinimumBox = GetDlgItem(hdlg, IDC_FRESH_MINIMUM_STATIC);
  689. hTypicalBox = GetDlgItem(hdlg, IDC_FRESH_TYPICAL_STATIC);
  690. hCustomBox = GetDlgItem(hdlg, IDC_FRESH_CUSTOM_STATIC);
  691. MyLoadString(IDS_FRESH_MINIMUM_STRING, csMinimumString);
  692. MyLoadString(IDS_FRESH_TYPICAL_STRING, csTypicalString);
  693. MyLoadString(IDS_FRESH_CUSTOM_STRING, csCustomString);
  694. SetWindowText(hMinimumBox, csMinimumString);
  695. SetWindowText(hTypicalBox, csTypicalString);
  696. SetWindowText(hCustomBox, csCustomString);
  697. break;
  698. case WM_COMMAND:
  699. if (HIWORD(wParam) == BN_CLICKED)
  700. {
  701. switch (LOWORD(wParam))
  702. {
  703. case IDC_MINIMUM:
  704. // check if tcpip is installed
  705. g_pTheApp->IsTCPIPInstalled();
  706. if (g_pTheApp->m_fTCPIP == FALSE && g_pTheApp->MsgBox(hSheet, IDS_NEED_TCPIP_WARNING, MB_OKCANCEL | MB_DEFBUTTON2, TRUE) == IDCANCEL)
  707. {
  708. SendMessage(hSheet, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), 0);
  709. break;
  710. }
  711. // set minimum default selections
  712. SetIISSetupMode(SETUPMODE_MINIMAL);
  713. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  714. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto setup page
  715. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  716. return TRUE;
  717. case IDC_TYPICAL:
  718. // check if tcpip is installed
  719. g_pTheApp->IsTCPIPInstalled();
  720. if (g_pTheApp->m_fTCPIP == FALSE && g_pTheApp->MsgBox(hSheet, IDS_NEED_TCPIP_WARNING, MB_OKCANCEL | MB_DEFBUTTON2, TRUE) == IDCANCEL)
  721. {
  722. SendMessage(hSheet, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), 0);
  723. break;
  724. }
  725. // set typical default selections
  726. SetIISSetupMode(SETUPMODE_TYPICAL);
  727. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  728. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto setup page
  729. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  730. return TRUE;
  731. case IDC_CUSTOM:
  732. // check if tcpip is installed
  733. g_pTheApp->IsTCPIPInstalled();
  734. if (g_pTheApp->m_fTCPIP == FALSE && g_pTheApp->MsgBox(hSheet, IDS_NEED_TCPIP_WARNING, MB_OKCANCEL | MB_DEFBUTTON2, TRUE) == IDCANCEL)
  735. {
  736. SendMessage(hSheet, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), 0);
  737. break;
  738. }
  739. // set typical default selections
  740. SetIISSetupMode(SETUPMODE_CUSTOM);
  741. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  742. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto OC page
  743. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  744. return TRUE;
  745. default:
  746. break;
  747. }
  748. }
  749. break;
  750. case WM_NOTIFY:
  751. pnmh = (LPNMHDR)lParam;
  752. switch (pnmh->code)
  753. {
  754. case PSN_SETACTIVE:
  755. // don't set on nt5
  756. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  757. if (g_pTheApp->m_eInstallMode == IM_FRESH)
  758. {
  759. if (g_pTheApp->m_fUnattended)
  760. {
  761. TCHAR szMode[_MAX_PATH] = _T("");
  762. INFCONTEXT Context;
  763. if ( SetupFindFirstLine_Wrapped(g_pTheApp->m_hUnattendFile, _T("Global"), _T("FreshMode"), &Context) )
  764. {
  765. SetupGetStringField(&Context, 1, szMode, _MAX_PATH, NULL);
  766. }
  767. if (_tcsicmp(szMode, _T("Minimal")) == 0)
  768. {
  769. SetIISSetupMode(SETUPMODE_MINIMAL);
  770. }
  771. else if (_tcsicmp(szMode, _T("Custom")) == 0)
  772. {
  773. SetIISSetupMode(SETUPMODE_CUSTOM);
  774. }
  775. else
  776. {
  777. SetIISSetupMode(SETUPMODE_TYPICAL);
  778. }
  779. }
  780. // Check if -m or -t or -f was passed in!
  781. BOOL fGot = FALSE;
  782. if (g_CmdLine_Set_M == TRUE) {SetIISSetupMode(SETUPMODE_MINIMAL);fGot = TRUE;}
  783. if (g_CmdLine_Set_T == TRUE) {SetIISSetupMode(SETUPMODE_TYPICAL);fGot = TRUE;}
  784. if (g_CmdLine_Set_F == TRUE) {SetIISSetupMode(SETUPMODE_CUSTOM);fGot = TRUE;}
  785. if (fGot || g_pTheApp->m_fUnattended) {
  786. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  787. }
  788. else
  789. {
  790. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK);
  791. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, 0);
  792. PostMessage(hdlg, WM_FINISH_INIT, 0, 0 );
  793. PostMessage(hdlg, DM_SETDEFID, (WPARAM)IDC_TYPICAL, 0);
  794. }
  795. }
  796. break;
  797. default:
  798. break;
  799. }
  800. break;
  801. case WM_FINISH_INIT:
  802. hTypical = GetDlgItem(hdlg, IDC_TYPICAL);
  803. SetFocus(hTypical);
  804. break;
  805. case WM_PAINT:
  806. {
  807. HDC hdc = NULL;
  808. PAINTSTRUCT ps;
  809. RECT rect;
  810. HWND hFrame = NULL;
  811. hdc = BeginPaint(hdlg, &ps);
  812. if (hdc)
  813. {
  814. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  815. if (hFrame)
  816. {
  817. GetClientRect(hFrame, &rect);
  818. OnPaintBitmap(hdlg, hdc, 1, &rect);
  819. }
  820. EndPaint(hdlg, &ps);
  821. }
  822. }
  823. break;
  824. default:
  825. bReturn = FALSE;
  826. break;
  827. }
  828. return(bReturn);
  829. }
  830. */
  831. INT_PTR CALLBACK pMaintenancePageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  832. {
  833. INT_PTR bReturn = TRUE;
  834. LPNMHDR pnmh;
  835. HWND hSheet = GetParent(hdlg);
  836. HWND hAddRemove = NULL, hReinstall = NULL, hRemoveAll = NULL;
  837. _tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pMaintenancePageDlgProc:"));
  838. _tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  839. SetIISSetupMode(SETUPMODE_ADDREMOVE);
  840. switch(msg)
  841. {
  842. case WM_NOTIFY:
  843. pnmh = (LPNMHDR)lParam;
  844. switch (pnmh->code)
  845. {
  846. case PSN_SETACTIVE:
  847. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  848. break;
  849. default:
  850. break;
  851. }
  852. break;
  853. case WM_PAINT:
  854. {
  855. HDC hdc = NULL;
  856. PAINTSTRUCT ps;
  857. RECT rect;
  858. HWND hFrame = NULL;
  859. hdc = BeginPaint(hdlg, &ps);
  860. if (hdc)
  861. {
  862. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  863. if (hFrame)
  864. {
  865. GetClientRect(hFrame, &rect);
  866. OnPaintBitmap(hdlg, hdc, 1, &rect);
  867. }
  868. EndPaint(hdlg, &ps);
  869. }
  870. }
  871. break;
  872. default:
  873. bReturn = FALSE;
  874. break;
  875. }
  876. return(bReturn);
  877. }
  878. /*
  879. // old code used when we had the maintenence page.
  880. // kept around in this comment block just in case we need it in the future.
  881. INT_PTR CALLBACK pMaintenancePageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  882. {
  883. INT_PTR bReturn = TRUE;
  884. LPNMHDR pnmh;
  885. HWND hSheet = GetParent(hdlg);
  886. HWND hAddRemove = NULL, hReinstall = NULL, hRemoveAll = NULL;
  887. BOOL iSaveOld_AllowMessageBoxPopups = FALSE;
  888. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pMaintenancePageDlgProc:"));
  889. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  890. switch(msg)
  891. {
  892. case WM_COMMAND:
  893. if (HIWORD(wParam) == BN_CLICKED)
  894. {
  895. switch (LOWORD(wParam))
  896. {
  897. case IDC_ADDREMOVE:
  898. // set minimum default selections
  899. SetIISSetupMode(SETUPMODE_ADDREMOVE);
  900. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  901. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto OC page
  902. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  903. return TRUE;
  904. case IDC_REINSTALL:
  905. // set typical default selections
  906. SetIISSetupMode(SETUPMODE_REINSTALL);
  907. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  908. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto setup page
  909. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  910. return TRUE;
  911. case IDC_REMOVEALL:
  912. // set typical default selections
  913. iSaveOld_AllowMessageBoxPopups = g_pTheApp->m_bAllowMessageBoxPopups;
  914. if (g_pTheApp->MsgBox(NULL, IDS_REMOVEALL_WARNING, MB_YESNO | MB_DEFBUTTON2, TRUE) == IDNO)
  915. {
  916. g_pTheApp->m_bAllowMessageBoxPopups = iSaveOld_AllowMessageBoxPopups;
  917. break;
  918. }
  919. g_pTheApp->m_bAllowMessageBoxPopups = iSaveOld_AllowMessageBoxPopups;
  920. SetIISSetupMode(SETUPMODE_REMOVEALL);
  921. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  922. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto setup page
  923. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  924. return TRUE;
  925. default:
  926. break;
  927. }
  928. }
  929. break;
  930. case WM_NOTIFY:
  931. pnmh = (LPNMHDR)lParam;
  932. switch (pnmh->code)
  933. {
  934. case PSN_SETACTIVE:
  935. // don't set on nt5
  936. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  937. if (g_pTheApp->m_fUnattended) {
  938. TCHAR szMode[_MAX_PATH] = _T("");
  939. INFCONTEXT Context;
  940. if ( SetupFindFirstLine_Wrapped(g_pTheApp->m_hUnattendFile, _T("Global"), _T("MaintenanceMode"), &Context) ) {
  941. SetupGetStringField(&Context, 1, szMode, _MAX_PATH, NULL);
  942. }
  943. if (_tcsicmp(szMode, _T("AddRemove")) == 0)
  944. {
  945. SetIISSetupMode(SETUPMODE_ADDREMOVE);
  946. }
  947. else if (_tcsicmp(szMode, _T("RemoveAll")) == 0)
  948. {
  949. SetIISSetupMode(SETUPMODE_REMOVEALL);
  950. }
  951. else
  952. {
  953. // Heck i don't know what type of mode this is. put up an error message.
  954. if ( gHelperRoutines.ReportExternalError )
  955. {
  956. CString csFormat, csMsg;
  957. MyLoadString(IDS_UNATTEND_UNSUPPORTED, csFormat);
  958. csMsg.Format( csFormat, szMode);
  959. gHelperRoutines.ReportExternalError(
  960. gHelperRoutines.OcManagerContext,
  961. _T("IIS"),
  962. NULL,
  963. (DWORD_PTR)(LPCTSTR) csMsg,
  964. ERRFLG_PREFORMATTED);
  965. }
  966. PropSheet_PressButton(hSheet, PSBTN_CANCEL);
  967. break;
  968. }
  969. //The old code
  970. //else if (_tcsicmp(szMode, _T("ReinstallFile")) == 0) {
  971. // SetIISSetupMode(SETUPMODE_REINSTALL);
  972. // g_pTheApp->m_bRefreshSettings = FALSE;
  973. //} else {
  974. // SetIISSetupMode(SETUPMODE_REINSTALL);
  975. // g_pTheApp->m_bRefreshSettings = TRUE;
  976. //}
  977. }
  978. if (g_pTheApp->m_fUnattended) {
  979. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  980. } else {
  981. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK);
  982. PostMessage(hdlg, WM_FINISH_INIT, 0, 0 );
  983. PostMessage(hdlg, DM_SETDEFID, (WPARAM)IDC_ADDREMOVE, 0);
  984. }
  985. break;
  986. default:
  987. break;
  988. }
  989. break;
  990. case WM_FINISH_INIT:
  991. hAddRemove = GetDlgItem(hdlg, IDC_ADDREMOVE);
  992. SetFocus(hAddRemove);
  993. break;
  994. case WM_PAINT:
  995. {
  996. HDC hdc = NULL;
  997. PAINTSTRUCT ps;
  998. RECT rect;
  999. HWND hFrame = NULL;
  1000. hdc = BeginPaint(hdlg, &ps);
  1001. if (hdc)
  1002. {
  1003. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  1004. if (hFrame)
  1005. {
  1006. GetClientRect(hFrame, &rect);
  1007. OnPaintBitmap(hdlg, hdc, 1, &rect);
  1008. }
  1009. EndPaint(hdlg, &ps);
  1010. }
  1011. }
  1012. break;
  1013. default:
  1014. bReturn = FALSE;
  1015. break;
  1016. }
  1017. return(bReturn);
  1018. }
  1019. */
  1020. INT_PTR CALLBACK pSrcPathPageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  1021. {
  1022. INT_PTR bReturn = TRUE;
  1023. LPNMHDR pnmh;
  1024. HWND hSheet = GetParent(hdlg);
  1025. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pSrcPathPageDlgProc:"));
  1026. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  1027. switch(msg)
  1028. {
  1029. case WM_INITDIALOG:
  1030. CheckRadioButton(hdlg,IDC_REINSTALL_REFRESH_FILES,IDC_REINSTALL_REFRESH_SETTINGS,IDC_REINSTALL_REFRESH_FILES);
  1031. break;
  1032. case WM_COMMAND:
  1033. if (HIWORD(wParam) == BN_CLICKED)
  1034. {
  1035. switch (LOWORD(wParam)) {
  1036. case IDC_REINSTALL_REFRESH_FILES:
  1037. case IDC_REINSTALL_REFRESH_SETTINGS:
  1038. CheckRadioButton(hdlg,IDC_REINSTALL_REFRESH_FILES,IDC_REINSTALL_REFRESH_SETTINGS,LOWORD(wParam));
  1039. break;
  1040. default:
  1041. break;
  1042. }
  1043. }
  1044. break;
  1045. case WM_NOTIFY:
  1046. pnmh = (LPNMHDR)lParam;
  1047. switch (pnmh->code)
  1048. {
  1049. case PSN_SETACTIVE:
  1050. // don't set on nt5
  1051. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  1052. if (g_pTheApp->m_dwSetupMode == SETUPMODE_REINSTALL && !g_pTheApp->m_fUnattended)
  1053. {
  1054. // accept the activation
  1055. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, 0);
  1056. }
  1057. else
  1058. {
  1059. // don't display this wizard page
  1060. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1061. }
  1062. break;
  1063. case PSN_WIZNEXT:
  1064. {
  1065. DWORD dwValue;
  1066. if (IsDlgButtonChecked(hdlg, IDC_REINSTALL_REFRESH_SETTINGS) == BST_CHECKED)
  1067. {g_pTheApp->m_bRefreshSettings = TRUE;}
  1068. else
  1069. {g_pTheApp->m_bRefreshSettings = FALSE;}
  1070. dwValue = (DWORD)(g_pTheApp->m_bRefreshSettings);
  1071. gHelperRoutines.SetPrivateData(gHelperRoutines.OcManagerContext,_T("ReinstallRefreshSettings"),(PVOID)&dwValue,sizeof(DWORD),REG_DWORD);
  1072. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  1073. }
  1074. break;
  1075. default:
  1076. break;
  1077. }
  1078. break;
  1079. case WM_PAINT:
  1080. {
  1081. HDC hdc = NULL;
  1082. PAINTSTRUCT ps;
  1083. RECT rect;
  1084. HWND hFrame = NULL;
  1085. hdc = BeginPaint(hdlg, &ps);
  1086. if (hdc)
  1087. {
  1088. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  1089. if (hFrame)
  1090. {
  1091. GetClientRect(hFrame, &rect);
  1092. OnPaintBitmap(hdlg, hdc, 1, &rect);
  1093. }
  1094. EndPaint(hdlg, &ps);
  1095. }
  1096. }
  1097. break;
  1098. default:
  1099. bReturn = FALSE;
  1100. break;
  1101. }
  1102. return(bReturn);
  1103. }
  1104. INT_PTR CALLBACK pUpgradePageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  1105. {
  1106. INT_PTR bReturn = TRUE;
  1107. LPNMHDR pnmh;
  1108. HWND hSheet = GetParent(hdlg);
  1109. HWND hUpgradeOnly = NULL, hAddExtraComps = NULL;
  1110. _tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pUpgradePageDlgProc:"));
  1111. _tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  1112. SetIISSetupMode(SETUPMODE_ADDEXTRACOMPS);
  1113. switch(msg)
  1114. {
  1115. case WM_NOTIFY:
  1116. pnmh = (LPNMHDR)lParam;
  1117. switch (pnmh->code)
  1118. {
  1119. case PSN_SETACTIVE:
  1120. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1121. break;
  1122. default:
  1123. break;
  1124. }
  1125. break;
  1126. case WM_PAINT:
  1127. {
  1128. HDC hdc = NULL;
  1129. PAINTSTRUCT ps;
  1130. RECT rect;
  1131. HWND hFrame = NULL;
  1132. hdc = BeginPaint(hdlg, &ps);
  1133. if (hdc)
  1134. {
  1135. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  1136. if (hFrame)
  1137. {
  1138. GetClientRect(hFrame, &rect);
  1139. OnPaintBitmap(hdlg, hdc, 1, &rect);
  1140. }
  1141. EndPaint(hdlg, &ps);
  1142. }
  1143. }
  1144. break;
  1145. default:
  1146. bReturn = FALSE;
  1147. break;
  1148. }
  1149. return(bReturn);
  1150. }
  1151. /*
  1152. // old code used when we had the upgrade page.
  1153. // kept around in this comment block just in case we need it in the future.
  1154. INT_PTR CALLBACK pUpgradePageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  1155. {
  1156. INT_PTR bReturn = TRUE;
  1157. LPNMHDR pnmh;
  1158. HWND hSheet = GetParent(hdlg);
  1159. HWND hUpgradeOnly = NULL, hAddExtraComps = NULL;
  1160. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pUpgradePageDlgProc:"));
  1161. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  1162. switch(msg)
  1163. {
  1164. case WM_COMMAND:
  1165. if (HIWORD(wParam) == BN_CLICKED)
  1166. {
  1167. switch (LOWORD(wParam))
  1168. {
  1169. case IDC_UPGRADEONLY:
  1170. // upgrade those previously installed components
  1171. SetIISSetupMode(SETUPMODE_UPGRADEONLY);
  1172. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  1173. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto setup page
  1174. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  1175. return TRUE;
  1176. case IDC_ADDEXTRACOMPS:
  1177. // upgrade those previously installed components + add extra components
  1178. SetIISSetupMode(SETUPMODE_ADDEXTRACOMPS);
  1179. SetCursor(LoadCursor(NULL,IDC_WAIT ));
  1180. PropSheet_PressButton(hSheet, PSBTN_NEXT); // goto OC page
  1181. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK | PSWIZB_NEXT);
  1182. return TRUE;
  1183. default:
  1184. break;
  1185. }
  1186. }
  1187. break;
  1188. case WM_NOTIFY:
  1189. pnmh = (LPNMHDR)lParam;
  1190. switch (pnmh->code)
  1191. {
  1192. case PSN_SETACTIVE:
  1193. // don't set on nt5
  1194. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  1195. if (g_pTheApp->m_fUnattended)
  1196. {
  1197. TCHAR szMode[_MAX_PATH] = _T("");
  1198. INFCONTEXT Context;
  1199. if ( SetupFindFirstLine_Wrapped(g_pTheApp->m_hUnattendFile, _T("Global"), _T("UpgradeMode"), &Context) )
  1200. {
  1201. SetupGetStringField(&Context, 1, szMode, _MAX_PATH, NULL);
  1202. }
  1203. if (_tcsicmp(szMode, _T("AddExtraComps")) == 0)
  1204. {
  1205. SetIISSetupMode(SETUPMODE_ADDEXTRACOMPS);
  1206. }
  1207. else
  1208. {
  1209. SetIISSetupMode(SETUPMODE_UPGRADEONLY);
  1210. }
  1211. }
  1212. if (g_pTheApp->m_fUnattended)
  1213. {
  1214. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1215. }
  1216. else
  1217. {
  1218. PropSheet_SetWizButtons(hSheet, PSWIZB_BACK);
  1219. PostMessage(hdlg, WM_FINISH_INIT, 0, 0 );
  1220. PostMessage(hdlg, DM_SETDEFID, (WPARAM)IDC_UPGRADEONLY, 0);
  1221. }
  1222. break;
  1223. default:
  1224. break;
  1225. }
  1226. break;
  1227. case WM_FINISH_INIT:
  1228. hUpgradeOnly = GetDlgItem(hdlg, IDC_UPGRADEONLY);
  1229. SetFocus(hUpgradeOnly);
  1230. break;
  1231. case WM_PAINT:
  1232. {
  1233. HDC hdc = NULL;
  1234. PAINTSTRUCT ps;
  1235. RECT rect;
  1236. HWND hFrame = NULL;
  1237. hdc = BeginPaint(hdlg, &ps);
  1238. if (hdc)
  1239. {
  1240. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  1241. if (hFrame)
  1242. {
  1243. GetClientRect(hFrame, &rect);
  1244. OnPaintBitmap(hdlg, hdc, 1, &rect);
  1245. }
  1246. EndPaint(hdlg, &ps);
  1247. }
  1248. }
  1249. break;
  1250. default:
  1251. bReturn = FALSE;
  1252. break;
  1253. }
  1254. return(bReturn);
  1255. }
  1256. */
  1257. INT_PTR CALLBACK pEarlyPageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  1258. {
  1259. INT_PTR bReturn = TRUE;
  1260. LPNMHDR pnmh;
  1261. HWND hSheet = NULL;
  1262. HWND hFTPGroup, hWWWGroup, hFTPBrowse, hWWWBrowse;
  1263. TCHAR szFTPRoot[_MAX_PATH], szWWWRoot[_MAX_PATH];
  1264. BOOL bShowTheDialogPage = TRUE;
  1265. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pEarlyPageDlgProc:"));
  1266. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  1267. TCHAR szSectionName[_MAX_PATH];
  1268. TCHAR szValue[_MAX_PATH] = _T("");
  1269. TCHAR szValue0[_MAX_PATH] = _T("");
  1270. _tcscpy(szSectionName, _T("InternetServer"));
  1271. switch(msg)
  1272. {
  1273. case WM_COMMAND:
  1274. if (HIWORD(wParam) == BN_CLICKED)
  1275. {
  1276. TCHAR buf[_MAX_PATH];
  1277. TCHAR szPath[_MAX_PATH];
  1278. switch (LOWORD(wParam))
  1279. {
  1280. case IDC_WWW_PUB_BROWSE:
  1281. g_hWWWEdit = GetDlgItem(hdlg, IDC_WWW_PUB_EDIT);
  1282. GetWindowText(g_hWWWEdit, szPath, _MAX_PATH);
  1283. if ( BrowseForDirectory( GetParent(hdlg), szPath,buf, _MAX_PATH, NULL, TRUE ))
  1284. {
  1285. SetWindowText(g_hWWWEdit, buf);
  1286. }
  1287. break;
  1288. case IDC_FTP_PUB_BROWSE:
  1289. g_hFTPEdit = GetDlgItem(hdlg, IDC_FTP_PUB_EDIT);
  1290. GetWindowText(g_hFTPEdit, szPath, _MAX_PATH);
  1291. if ( BrowseForDirectory( GetParent(hdlg), szPath,buf, _MAX_PATH, NULL, TRUE ))
  1292. {
  1293. SetWindowText(g_hFTPEdit, buf);
  1294. }
  1295. break;
  1296. }
  1297. }
  1298. break;
  1299. case WM_NOTIFY:
  1300. pnmh = (LPNMHDR)lParam;
  1301. hSheet = GetParent(hdlg);
  1302. switch (pnmh->code)
  1303. {
  1304. case PSN_SETACTIVE:
  1305. {
  1306. g_bFTP = ToBeInstalled(TEXT("iis"), TEXT("iis_ftp"));
  1307. g_bWWW = ToBeInstalled(TEXT("iis"), TEXT("iis_www"));
  1308. BOOL bDisplay = FALSE; // display this wizard or not
  1309. if (g_pTheApp->m_fUnattended)
  1310. {
  1311. INFCONTEXT Context;
  1312. if (g_bFTP)
  1313. {
  1314. // Default it incase SetupFindFirstLine fails
  1315. _tcscpy(szValue, g_pTheApp->m_csPathFTPRoot);
  1316. if (g_pTheApp->m_hUnattendFile != INVALID_HANDLE_VALUE && g_pTheApp->m_hUnattendFile != NULL)
  1317. {
  1318. if ( SetupFindFirstLine_Wrapped(g_pTheApp->m_hUnattendFile, szSectionName, _T("PathFTPRoot"), &Context) )
  1319. {
  1320. SetupGetStringField(&Context, 1, szValue, _MAX_PATH, NULL);
  1321. }
  1322. if (*szValue)
  1323. {
  1324. _tcscpy(szValue0, szValue);
  1325. if (!ExpandEnvironmentStrings( (LPCTSTR)szValue0, szValue, sizeof(szValue)/sizeof(TCHAR)))
  1326. {_tcscpy(szValue,szValue0);}
  1327. if (!IsValidDirectoryName(szValue))
  1328. bDisplay = TRUE;
  1329. else
  1330. CustomFTPRoot(szValue);
  1331. }
  1332. }
  1333. }
  1334. if (g_bWWW)
  1335. {
  1336. // Default it incase SetupFindFirstLine fails
  1337. _tcscpy(szValue, g_pTheApp->m_csPathWWWRoot);
  1338. if (g_pTheApp->m_hUnattendFile != INVALID_HANDLE_VALUE && g_pTheApp->m_hUnattendFile != NULL)
  1339. {
  1340. if ( SetupFindFirstLine_Wrapped(g_pTheApp->m_hUnattendFile, szSectionName, _T("PathWWWRoot"), &Context) )
  1341. {
  1342. SetupGetStringField(&Context, 1, szValue, _MAX_PATH, NULL);
  1343. }
  1344. _tcscpy(szValue0, szValue);
  1345. if (!ExpandEnvironmentStrings( (LPCTSTR)szValue0, szValue, sizeof(szValue)/sizeof(TCHAR)))
  1346. {_tcscpy(szValue,szValue0);}
  1347. if (*szValue)
  1348. {
  1349. if (!IsValidDirectoryName(szValue))
  1350. bDisplay = TRUE;
  1351. else
  1352. CustomWWWRoot(szValue);
  1353. }
  1354. }
  1355. }
  1356. if (bDisplay)
  1357. {
  1358. g_pTheApp->MsgBox(NULL, IDS_NEED_VALID_PATH_UNATTENDED, MB_OK, FALSE);
  1359. PropSheet_SetWizButtons(hSheet, PSWIZB_NEXT);
  1360. }
  1361. } // end of unattended
  1362. bShowTheDialogPage = FALSE;
  1363. if ( g_pTheApp->m_fUnattended)
  1364. {
  1365. if (bDisplay) bShowTheDialogPage = TRUE;
  1366. }
  1367. else
  1368. {
  1369. // this is attended mode, either gui or standalone
  1370. if (g_pTheApp->m_fInvokedByNT)
  1371. {
  1372. // if attended guimode then don't show this dialog page
  1373. bShowTheDialogPage = FALSE;
  1374. }
  1375. else
  1376. {
  1377. // If it's attended mode, then show this page
  1378. if ( g_bFTP || g_bWWW ) {bShowTheDialogPage = TRUE;}
  1379. }
  1380. }
  1381. if (bShowTheDialogPage)
  1382. {
  1383. iisDebugOut((LOG_TYPE_TRACE, _T("showpage.bShowTheDialogPage")));
  1384. hFTPGroup = GetDlgItem(hdlg, IDC_FTP_PUB_GROUP);
  1385. hWWWGroup = GetDlgItem(hdlg, IDC_WWW_PUB_GROUP);
  1386. g_hFTPEdit = GetDlgItem(hdlg, IDC_FTP_PUB_EDIT);
  1387. g_hWWWEdit = GetDlgItem(hdlg, IDC_WWW_PUB_EDIT);
  1388. hFTPBrowse = GetDlgItem(hdlg, IDC_FTP_PUB_BROWSE);
  1389. hWWWBrowse = GetDlgItem(hdlg, IDC_WWW_PUB_BROWSE);
  1390. EnableWindow(hFTPGroup, g_bFTP);
  1391. EnableWindow(g_hFTPEdit, g_bFTP);
  1392. EnableWindow(hFTPBrowse, g_bFTP);
  1393. if (g_bFTP)
  1394. {SetWindowText(g_hFTPEdit, g_pTheApp->m_csPathFTPRoot);}
  1395. else
  1396. {SetWindowText(g_hFTPEdit, TEXT(""));}
  1397. EnableWindow(hWWWGroup, g_bWWW);
  1398. EnableWindow(g_hWWWEdit, g_bWWW);
  1399. EnableWindow(hWWWBrowse, g_bWWW);
  1400. if (g_bWWW)
  1401. {SetWindowText(g_hWWWEdit, g_pTheApp->m_csPathWWWRoot);}
  1402. else
  1403. {SetWindowText(g_hWWWEdit, TEXT(""));}
  1404. // accept the activation
  1405. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, 0);
  1406. }
  1407. else
  1408. {
  1409. // check if inetsrv is a valid directory
  1410. TCHAR szInetsrv[_MAX_PATH];
  1411. _tcscpy(szInetsrv, g_pTheApp->m_csPathInetsrv);
  1412. while (!IsValidDirectoryName(szInetsrv))
  1413. {
  1414. MyMessageBox(NULL, IDS_INVALID_DIR_INETSRV, g_pTheApp->m_csPathInetsrv, MB_OK | MB_SETFOREGROUND);
  1415. }
  1416. // don't display this wizard page
  1417. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1418. }
  1419. break;
  1420. }
  1421. case PSN_WIZNEXT:
  1422. if (g_bFTP)
  1423. {
  1424. GetWindowText(g_hFTPEdit, szFTPRoot, _MAX_PATH);
  1425. CleanPathString(szFTPRoot);
  1426. if (!IsValidDirectoryName(szFTPRoot))
  1427. {
  1428. g_pTheApp->MsgBox(NULL, IDS_NEED_INPUT_FTP, MB_OK, FALSE);
  1429. SetWindowText(g_hFTPEdit, g_pTheApp->m_csPathFTPRoot);
  1430. SetFocus(g_hFTPEdit);
  1431. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1432. break;
  1433. }
  1434. }
  1435. if (g_bWWW)
  1436. {
  1437. GetWindowText(g_hWWWEdit, szWWWRoot, _MAX_PATH);
  1438. CleanPathString(szWWWRoot);
  1439. if (!IsValidDirectoryName(szWWWRoot))
  1440. {
  1441. g_pTheApp->MsgBox(NULL, IDS_NEED_INPUT_WWW, MB_OK, FALSE);
  1442. SetWindowText(g_hWWWEdit, g_pTheApp->m_csPathWWWRoot);
  1443. SetFocus(g_hWWWEdit);
  1444. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1445. break;
  1446. }
  1447. }
  1448. if (g_bFTP) {CustomFTPRoot(szFTPRoot);}
  1449. if (g_bWWW) {CustomWWWRoot(szWWWRoot);}
  1450. // check if inetsrv is a valid directory
  1451. TCHAR szInetsrv[_MAX_PATH];
  1452. _tcscpy(szInetsrv, g_pTheApp->m_csPathInetsrv);
  1453. while (!IsValidDirectoryName(szInetsrv))
  1454. {
  1455. MyMessageBox(NULL, IDS_INVALID_DIR_INETSRV, g_pTheApp->m_csPathInetsrv, MB_OK | MB_SETFOREGROUND);
  1456. }
  1457. break;
  1458. default:
  1459. break;
  1460. }
  1461. break;
  1462. case WM_PAINT:
  1463. {
  1464. HDC hdc = NULL;
  1465. PAINTSTRUCT ps;
  1466. RECT rect;
  1467. HWND hFrame = NULL;
  1468. hdc = BeginPaint(hdlg, &ps);
  1469. if (hdc)
  1470. {
  1471. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  1472. if (hFrame)
  1473. {
  1474. GetClientRect(hFrame, &rect);
  1475. OnPaintBitmap(hdlg, hdc, 2, &rect);
  1476. }
  1477. EndPaint(hdlg, &ps);
  1478. }
  1479. }
  1480. break;
  1481. default:
  1482. bReturn = FALSE;
  1483. break;
  1484. }
  1485. return(bReturn);
  1486. }
  1487. INT_PTR CALLBACK pEndPageDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
  1488. {
  1489. INT_PTR bReturn = TRUE;
  1490. LPNMHDR pnmh;
  1491. HWND hSheet = NULL;
  1492. HWND hCancel = NULL;
  1493. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo, _T("pEndPageDlgProc:"));
  1494. //_tcscpy(g_MyLogFile.m_szLogPreLineInfo2, _T(""));
  1495. switch(msg)
  1496. {
  1497. case WM_INITDIALOG:
  1498. // display running services in case our services need other services to be running!
  1499. //StartInstalledServices();
  1500. break;
  1501. case WM_COMMAND:
  1502. break;
  1503. case WM_NOTIFY:
  1504. pnmh = (LPNMHDR)lParam;
  1505. hSheet = GetParent(hdlg);
  1506. switch (pnmh->code)
  1507. {
  1508. case PSN_SETACTIVE:
  1509. if (g_pTheApp->m_fUnattended)
  1510. {
  1511. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1512. //PropSheet_PressButton(hSheet, PSBTN_NEXT);
  1513. PropSheet_PressButton(hSheet, PSBTN_FINISH);
  1514. }
  1515. else
  1516. {
  1517. if (g_pTheApp->m_fInvokedByNT)
  1518. {
  1519. SetWindowLongPtr(hdlg, DWLP_MSGRESULT, -1);
  1520. //PropSheet_PressButton(hSheet, PSBTN_NEXT);
  1521. PropSheet_PressButton(hSheet, PSBTN_FINISH);
  1522. }
  1523. else
  1524. {
  1525. // don't set on nt5
  1526. //SetWindowText(GetParent(hdlg), g_pTheApp->m_csSetupTitle);
  1527. // enable buttons
  1528. PropSheet_SetWizButtons(hSheet, PSWIZB_FINISH);
  1529. hCancel = GetDlgItem(hSheet, IDCANCEL);
  1530. if (hCancel){EnableWindow(hCancel, FALSE);}
  1531. }
  1532. }
  1533. break;
  1534. default:
  1535. break;
  1536. }
  1537. break;
  1538. case WM_PAINT:
  1539. {
  1540. HDC hdc = NULL;
  1541. PAINTSTRUCT ps;
  1542. RECT rect;
  1543. HWND hFrame = NULL;
  1544. hdc = BeginPaint(hdlg, &ps);
  1545. if (hdc)
  1546. {
  1547. hFrame = GetDlgItem(hdlg, IDC_FRAME_BANNER);
  1548. if (hFrame)
  1549. {
  1550. GetClientRect(hFrame, &rect);
  1551. OnPaintBitmap(hdlg, hdc, 1, &rect);
  1552. }
  1553. EndPaint(hdlg, &ps);
  1554. }
  1555. }
  1556. break;
  1557. default:
  1558. bReturn = FALSE;
  1559. break;
  1560. }
  1561. return(bReturn);
  1562. }
  1563. #endif // ENABLE_OC_PAGES