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.

698 lines
27 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994 **
  4. //*********************************************************************
  5. #include "pre.h"
  6. #include "icwaprtc.h"
  7. #define BITMAP_WIDTH 164
  8. #define BITMAP_HEIGHT 458
  9. /*******************************************************************
  10. NAME: GetDlgIDFromIndex
  11. SYNOPSIS: For a given zero-based page index, returns the
  12. corresponding dialog ID for the page
  13. 4/24/97 jmazner When dealing with apprentice pages, we may call
  14. this function with dialog IDs (IDD_PAGE_*), rather
  15. than an index (ORD_PAGE*). Added code to check
  16. whether the number passed in is an index or dlgID.
  17. ********************************************************************/
  18. UINT GetDlgIDFromIndex(UINT uPageIndex)
  19. {
  20. if( uPageIndex <= MAX_PAGE_INDEX )
  21. {
  22. ASSERT(uPageIndex < NUM_WIZARD_PAGES);
  23. return PageInfo[uPageIndex].uDlgID;
  24. }
  25. else
  26. {
  27. return(uPageIndex);
  28. }
  29. }
  30. //
  31. // GENDLG.C -
  32. // Generic DLG proc for common wizard functions
  33. //
  34. // HISTORY:
  35. //
  36. // 05/13/98 donaldm Created.
  37. //
  38. // ############################################################################
  39. HRESULT MakeWizard97Title (HWND hwnd)
  40. {
  41. HRESULT hr = ERROR_SUCCESS;
  42. HFONT hfont = NULL;
  43. HFONT hnewfont = NULL;
  44. LOGFONT *plogfont = NULL;
  45. HDC hDC;
  46. if (!hwnd) goto MakeWizard97TitleExit;
  47. hfont = (HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
  48. if (!hfont)
  49. {
  50. hr = ERROR_GEN_FAILURE;
  51. goto MakeWizard97TitleExit;
  52. }
  53. plogfont = (LOGFONT*)malloc(sizeof(LOGFONT));
  54. if (!plogfont)
  55. {
  56. hr = ERROR_NOT_ENOUGH_MEMORY;
  57. goto MakeWizard97TitleExit;
  58. }
  59. if (!GetObject(hfont,sizeof(LOGFONT),(LPVOID)plogfont))
  60. {
  61. hr = ERROR_GEN_FAILURE;
  62. goto MakeWizard97TitleExit;
  63. }
  64. // We want 12 PT Veranda for Wizard 97.
  65. hDC = GetDC(NULL);
  66. if(hDC)
  67. {
  68. plogfont->lfHeight = -MulDiv(WIZ97_TITLE_FONT_PTS, GetDeviceCaps(hDC, LOGPIXELSY), 72);
  69. ReleaseDC(NULL, hDC);
  70. }
  71. plogfont->lfWeight = (int) FW_BOLD;
  72. if (!LoadString(ghInstanceResDll, IDS_WIZ97_TITLE_FONT_FACE, plogfont->lfFaceName, LF_FACESIZE))
  73. lstrcpy(plogfont->lfFaceName, TEXT("Verdana"));
  74. if (!(hnewfont = CreateFontIndirect(plogfont)))
  75. {
  76. hr = ERROR_GEN_FAILURE;
  77. goto MakeWizard97TitleExit;
  78. }
  79. SendMessage(hwnd,WM_SETFONT,(WPARAM)hnewfont,MAKELPARAM(TRUE,0));
  80. free(plogfont);
  81. MakeWizard97TitleExit:
  82. //if (hfont) DeleteObject(hfont);
  83. // BUG:? Do I need to delete hnewfont at some time?
  84. // The answer is Yes. ChrisK 7/1/96
  85. return hr;
  86. }
  87. // ############################################################################
  88. HRESULT ReleaseBold(HWND hwnd)
  89. {
  90. HFONT hfont = NULL;
  91. hfont = (HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
  92. if (hfont) DeleteObject(hfont);
  93. return ERROR_SUCCESS;
  94. }
  95. /*******************************************************************
  96. Function: PaintWithPaletteBitmap
  97. Arguments: lprc is the target rectangle.
  98. cy is the putative dimensions of hbmpPaint.
  99. If the target rectangle is taller than cy, then
  100. fill the rest with the pixel in the upper left
  101. corner of the hbmpPaint.
  102. Returns: void
  103. History: 10-29-98 Vyung Stole from prsht.c
  104. ********************************************************************/
  105. void PaintWithPaletteBitmap(HDC hdc, LPRECT lprc, int cy, HBITMAP hbmpPaint)
  106. {
  107. HDC hdcBmp;
  108. hdcBmp = CreateCompatibleDC(hdc);
  109. SelectObject(hdcBmp, hbmpPaint);
  110. BitBlt(hdc, lprc->left, lprc->top, RECTWIDTH(*lprc), cy, hdcBmp, 0, 0, SRCCOPY);
  111. // StretchBlt does mirroring if you pass a negative height,
  112. // so do the stretch only if there actually is unpainted space
  113. if (RECTHEIGHT(*lprc) - cy > 0)
  114. StretchBlt(hdc, lprc->left, cy,
  115. RECTWIDTH(*lprc), RECTHEIGHT(*lprc) - cy,
  116. hdcBmp, 0, 0, 1, 1, SRCCOPY);
  117. DeleteDC(hdcBmp);
  118. }
  119. /*******************************************************************
  120. //
  121. // Function: Prsht_EraseWizBkgnd
  122. //
  123. // Arguments: Draw the background for wizard pages.
  124. // hDlg is dialog handle.
  125. // hdc is device context
  126. //
  127. // Returns: void
  128. //
  129. // History: 10-29-98 Vyung - Stole from prsht.c
  130. //
  131. ********************************************************************/
  132. LRESULT Prsht_EraseWizBkgnd(HWND hDlg, HDC hdc)
  133. {
  134. HBRUSH hbrWindow = GetSysColorBrush(COLOR_WINDOW);
  135. RECT rc;
  136. GetClientRect(hDlg, &rc);
  137. FillRect(hdc, &rc, hbrWindow);
  138. rc.right = BITMAP_WIDTH;
  139. rc.left = 0;
  140. PaintWithPaletteBitmap(hdc, &rc, BITMAP_HEIGHT, gpWizardState->cmnStateData.hbmWatermark);
  141. return TRUE;
  142. }
  143. //-----------------------------------------------------------------------------
  144. // Function MiscInitProc
  145. //
  146. // Synopsis Our generic dialog proc calls this in case any of the wizard
  147. // dialogs have to do any sneaky stuff.
  148. //
  149. // Arguments: hDlg - dialog window
  150. // fFirstInit - TRUE if this is the first time the dialog
  151. // is initialized, FALSE if this InitProc has been called
  152. // before (e.g. went past this page and backed up)
  153. //
  154. // Returns: TRUE
  155. //
  156. // History: 10/28/96 ValdonB Created
  157. // 11/25/96 Jmazner copied from icwconn1\psheet.cpp
  158. // Normandy #10586
  159. //
  160. //-----------------------------------------------------------------------------
  161. BOOL CALLBACK MiscInitProc
  162. (
  163. HWND hDlg,
  164. BOOL fFirstInit,
  165. UINT uDlgID
  166. )
  167. {
  168. // switch( uDlgID )
  169. // {
  170. // }
  171. return TRUE;
  172. }
  173. /*******************************************************************
  174. NAME: GenDlgProc
  175. SYNOPSIS: Generic dialog proc for all wizard pages
  176. NOTES: This dialog proc provides the following default behavior:
  177. init: back and next buttons enabled
  178. next btn: switches to page following current page
  179. back btn: switches to previous page
  180. cancel btn: prompts user to confirm, and cancels the wizard
  181. dlg ctrl: does nothing (in response to WM_COMMANDs)
  182. Wizard pages can specify their own handler functions
  183. (in the PageInfo table) to override default behavior for
  184. any of the above actions.
  185. ********************************************************************/
  186. INT_PTR CALLBACK GenDlgProc
  187. (
  188. HWND hDlg,
  189. UINT uMsg,
  190. WPARAM wParam,
  191. LPARAM lParam
  192. )
  193. {
  194. static HCURSOR hcurOld = NULL;
  195. PAGEINFO *pPageInfo = (PAGEINFO *) GetWindowLongPtr(hDlg,DWLP_USER);
  196. ASSERT(pPageInfo);
  197. switch (uMsg)
  198. {
  199. case WM_ERASEBKGND:
  200. {
  201. if(gpWizardState->cmnStateData.bOEMCustom)
  202. {
  203. // Set ICW completed bit and remove the getconn icon
  204. if (gpWizardState->cmnStateData.lpfnFillWindowWithAppBackground)
  205. (*gpWizardState->cmnStateData.lpfnFillWindowWithAppBackground)(hDlg, (HDC) wParam);
  206. return TRUE;
  207. }
  208. else
  209. {
  210. // Only paint the external page
  211. if ((!pPageInfo->nIdTitle) && (IDD_PAGE_ISPSELECT != pPageInfo->uDlgID))
  212. {
  213. Prsht_EraseWizBkgnd(hDlg, (HDC) wParam);
  214. return TRUE;
  215. }
  216. }
  217. break;
  218. }
  219. GENDLG_CTLCOLOR:
  220. case WM_CTLCOLOR:
  221. case WM_CTLCOLORMSGBOX:
  222. case WM_CTLCOLORLISTBOX:
  223. case WM_CTLCOLORBTN:
  224. case WM_CTLCOLORSCROLLBAR:
  225. {
  226. // Only paint the external page and except the ISP sel page
  227. if ((!pPageInfo->nIdTitle) && (IDD_PAGE_ISPSELECT != pPageInfo->uDlgID))
  228. {
  229. HBRUSH hbrWindow = GetSysColorBrush(COLOR_WINDOW);
  230. DefWindowProc(hDlg, uMsg, wParam, lParam);
  231. SetBkMode((HDC)wParam, TRANSPARENT);
  232. return (LRESULT)hbrWindow;
  233. }
  234. break;
  235. }
  236. // We need to make sure static controls draw transparently
  237. // on the background bitmap. This is done by painting in
  238. // the appropriate portion of the background, and then
  239. // returning a NULL brush so the control just draws the text
  240. case WM_CTLCOLORSTATIC:
  241. if(gpWizardState->cmnStateData.bOEMCustom)
  242. {
  243. SetTextColor((HDC)wParam, gpWizardState->cmnStateData.clrText);
  244. if (!(GetWindowLong((HWND)lParam, GWL_STYLE) & ES_READONLY))
  245. {
  246. SetBkMode((HDC)wParam, TRANSPARENT);
  247. return (INT_PTR) GetStockObject(NULL_BRUSH);
  248. }
  249. break;
  250. }
  251. else
  252. {
  253. // Not in modeless opperation so just do the default cltcolor
  254. // handling
  255. goto GENDLG_CTLCOLOR;
  256. }
  257. case WM_INITDIALOG:
  258. {
  259. // get propsheet page struct passed in
  260. LPPROPSHEETPAGE lpsp = (LPPROPSHEETPAGE) lParam;
  261. ASSERT(lpsp);
  262. // fetch our private page info from propsheet struct
  263. pPageInfo = (PAGEINFO *)lpsp->lParam;
  264. ASSERT(pPageInfo);
  265. // store pointer to private page info in window data for later
  266. SetWindowLongPtr(hDlg,DWLP_USER,(LPARAM) pPageInfo);
  267. // initialize 'back' and 'next' wizard buttons, if
  268. // page wants something different it can fix in init proc below
  269. PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT | PSWIZB_BACK);
  270. // Make the title text bold
  271. MakeWizard97Title(GetDlgItem(hDlg,IDC_LBLTITLE));
  272. // call init proc for this page if one is specified
  273. if (pPageInfo->InitProc)
  274. {
  275. if (!( pPageInfo->InitProc(hDlg,TRUE, NULL)))
  276. {
  277. // If a fatal error occured, quit the wizard.
  278. // Note: gfQuitWizard is also used to terminate the wizard
  279. // for non-error reasons, but in that case TRUE is returned
  280. // from the OK proc and the case is handled below.
  281. if (gfQuitWizard)
  282. {
  283. // Don't reboot if error occured.
  284. gpWizardState->fNeedReboot = FALSE;
  285. // send a 'cancel' message to ourselves (to keep the prop.
  286. // page mgr happy)
  287. //
  288. // ...Unless we're serving as an Apprentice. In which case, let
  289. // the Wizard decide how to deal with this.
  290. PropSheet_PressButton(GetParent(hDlg),PSBTN_CANCEL);
  291. }
  292. }
  293. }
  294. // 11/25/96 jmazner Normandy #10586 (copied from icwconn1)
  295. // Before we return, lets send another message to ourself so
  296. // we have a second chance of initializing stuff that the
  297. // property sheet wizard doesn't normally let us do.
  298. PostMessage(hDlg, WM_MYINITDIALOG, 1, lParam);
  299. return TRUE;
  300. }
  301. break; // WM_INITDIALOG
  302. // 11/25/96 jmazner Normandy #10586 (copied from icwconn1)
  303. case WM_MYINITDIALOG:
  304. {
  305. // reset the state so that we can download data.
  306. gfUserCancelled = FALSE;
  307. if (pPageInfo->PostInitProc)
  308. {
  309. if (!( pPageInfo->PostInitProc(hDlg,(BOOL)wParam, NULL)))
  310. {
  311. // If a fatal error occured, quit the wizard.
  312. // Note: gfQuitWizard is also used to terminate the wizard
  313. // for non-error reasons, but in that case TRUE is returned
  314. // from the OK proc and the case is handled below.
  315. if (gfQuitWizard)
  316. {
  317. // Don't reboot if error occured.
  318. gpWizardState->fNeedReboot = FALSE;
  319. // send a 'cancel' message to ourselves (to keep the prop.
  320. // page mgr happy)
  321. //
  322. // ...Unless we're serving as an Apprentice. In which case, let
  323. // the Wizard decide how to deal with this.
  324. PropSheet_PressButton(GetParent(hDlg),PSBTN_CANCEL);
  325. }
  326. }
  327. }
  328. // wParam tells whether this is the first initialization or not
  329. MiscInitProc(hDlg, (BOOL)wParam, pPageInfo->uDlgID);
  330. return TRUE;
  331. }
  332. case WM_DESTROY:
  333. ReleaseBold(GetDlgItem(hDlg,IDC_LBLTITLE));
  334. break;
  335. #ifdef HAS_HELP
  336. case WM_HELP:
  337. {
  338. DWORD dwData = 1000;
  339. WinHelp(hDlg,"connect.hlp>proc4",HELP_CONTEXT, dwData);
  340. break;
  341. }
  342. #endif
  343. case WM_NOTIFY:
  344. {
  345. BOOL fRet,fKeepHistory=TRUE;
  346. NMHDR * lpnm = (NMHDR *) lParam;
  347. #define NEXTPAGEUNITIALIZED -1
  348. int iNextPage = NEXTPAGEUNITIALIZED;
  349. switch (lpnm->code)
  350. {
  351. case PSN_TRANSLATEACCELERATOR:
  352. {
  353. // If the WEBOC is active, then we should let if have a crack as
  354. // the accelerator
  355. if ((pPageInfo->bIsHostingWebOC) || g_bCustomPaymentActive)
  356. {
  357. //SUCEEDED macro will not work here cuz ret maybe S_FALSE
  358. if (S_OK == gpWizardState->pICWWebView->HandleKey((LPMSG)((PSHNOTIFY*)lParam)->lParam))
  359. SetWindowLongPtr(hDlg,DWLP_MSGRESULT, PSNRET_MESSAGEHANDLED);
  360. else
  361. SetWindowLongPtr(hDlg,DWLP_MSGRESULT, PSNRET_NOERROR);
  362. }
  363. else
  364. {
  365. SetWindowLongPtr(hDlg,DWLP_MSGRESULT, PSNRET_NOERROR);
  366. }
  367. return TRUE;
  368. }
  369. case PSN_SETACTIVE:
  370. // If a fatal error occured in first call to init proc
  371. // from WM_INITDIALOG, don't call init proc again.
  372. if (FALSE == gfQuitWizard)
  373. {
  374. // For modeless operation, we are suppressing the painting
  375. // of the wizard page background to get the effect of
  376. // transparency, so we need to for an update of the
  377. // app's client area after hiding the current page.
  378. if(gpWizardState->cmnStateData.bOEMCustom)
  379. {
  380. // Set the position of the page that is being activated
  381. SetWindowPos(hDlg, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
  382. // Set the page title
  383. if (pPageInfo->nIdTitle)
  384. {
  385. SendMessage(gpWizardState->cmnStateData.hWndApp, WUM_SETTITLE, (WPARAM)ghInstanceResDll, MAKELONG(pPageInfo->nIdTitle, 0));
  386. }
  387. }
  388. // initialize 'back' and 'next' wizard buttons, if
  389. // page wants something different it can fix in init proc below
  390. PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT | PSWIZB_BACK);
  391. // call init proc for this page if one is specified
  392. if (pPageInfo->InitProc)
  393. {
  394. pPageInfo->InitProc(hDlg,FALSE, (UINT*)&iNextPage);
  395. if (NEXTPAGEUNITIALIZED != iNextPage)
  396. {
  397. // Skipping
  398. SetPropSheetResult(hDlg,GetDlgIDFromIndex(iNextPage));
  399. return (iNextPage);
  400. }
  401. }
  402. }
  403. // If we set the wait cursor, set the cursor back
  404. if (hcurOld)
  405. {
  406. SetCursor(hcurOld);
  407. hcurOld = NULL;
  408. }
  409. PostMessage(hDlg, WM_MYINITDIALOG, 0, lParam);
  410. return TRUE;
  411. break;
  412. case PSN_WIZNEXT:
  413. case PSN_WIZBACK:
  414. case PSN_WIZFINISH:
  415. // Change cursor to an hour glass
  416. hcurOld = SetCursor(LoadCursor(NULL, IDC_WAIT));
  417. // call OK proc for this page if one is specified
  418. if (pPageInfo->OKProc)
  419. {
  420. if (!pPageInfo->OKProc(hDlg,(lpnm->code != PSN_WIZBACK), (UINT*)&iNextPage,&fKeepHistory))
  421. {
  422. // If a fatal error occured, quit the wizard.
  423. // Note: gfQuitWizard is also used to terminate the wizard
  424. // for non-error reasons, but in that case TRUE is returned
  425. // from the OK proc and the case is handled below.
  426. if (gfQuitWizard)
  427. {
  428. // Don't reboot if error occured.
  429. gpWizardState->fNeedReboot = FALSE;
  430. // send a 'cancel' message to ourselves (to keep the prop.
  431. // page mgr happy)
  432. //
  433. // ...Unless we're serving as an Apprentice. In which case, let
  434. // the Wizard decide how to deal with this.
  435. PropSheet_PressButton(GetParent(hDlg),PSBTN_CANCEL);
  436. }
  437. // stay on this page
  438. SetPropSheetResult(hDlg,-1);
  439. return TRUE;
  440. }
  441. }
  442. if (lpnm->code != PSN_WIZBACK)
  443. {
  444. // 'next' pressed
  445. ASSERT(gpWizardState->uPagesCompleted < NUM_WIZARD_PAGES);
  446. // save the current page index in the page history,
  447. // unless this page told us not to when we called
  448. // its OK proc above
  449. if (fKeepHistory)
  450. {
  451. gpWizardState->uPageHistory[gpWizardState->uPagesCompleted] = gpWizardState->uCurrentPage;
  452. TraceMsg(TF_GENDLG, "GENDLG: added page %d (IDD %d) to history list",
  453. gpWizardState->uCurrentPage, GetDlgIDFromIndex(gpWizardState->uCurrentPage));
  454. gpWizardState->uPagesCompleted++;
  455. }
  456. else
  457. {
  458. TraceMsg(TF_GENDLG, "GENDLG: not adding %d (IDD: %d) to the history list",
  459. gpWizardState->uCurrentPage, GetDlgIDFromIndex(gpWizardState->uCurrentPage));
  460. }
  461. // if no next page specified or no OK proc,
  462. // advance page by one
  463. if (0 > iNextPage)
  464. iNextPage = gpWizardState->uCurrentPage + 1;
  465. }
  466. else
  467. {
  468. // 'back' pressed
  469. // If we have completed no pages, then we are on the first page
  470. // of the DLL process, so back really means go to the
  471. // external prev. page.
  472. if (0 == gpWizardState->uPagesCompleted)
  473. {
  474. iNextPage = g_uExternUIPrev;
  475. }
  476. // See if we need to get the page from the history list
  477. if( NEXTPAGEUNITIALIZED == iNextPage )
  478. {
  479. ASSERT(gpWizardState->uPagesCompleted > 0);
  480. // get the last page from the history list
  481. gpWizardState->uPagesCompleted --;
  482. iNextPage = gpWizardState->uPageHistory[gpWizardState->uPagesCompleted];
  483. TraceMsg(TF_GENDLG, "GENDLG: extracting page %d (IDD %d) from history list",iNextPage, GetDlgIDFromIndex(iNextPage));
  484. }
  485. }
  486. // if we need to exit the wizard now (e.g. launching
  487. // signup app and want to terminate the wizard), send
  488. // a 'cancel' message to ourselves (to keep the prop.
  489. // page mgr happy)
  490. if (gfQuitWizard)
  491. {
  492. //
  493. // if we are going from manual to conn1 then
  494. // then do not show the REBOOT dialog but
  495. // still preserve the gpWizardState -MKarki Bug #404
  496. //
  497. if (lpnm->code == PSN_WIZBACK)
  498. {
  499. gfBackedUp = TRUE;
  500. gfReboot = gpWizardState->fNeedReboot;
  501. }
  502. // send a 'cancel' message to ourselves (to keep the prop.
  503. // page mgr happy)
  504. //
  505. // ...Unless we're serving as an Apprentice. In which case, let
  506. // the Wizard decide how to deal with this.
  507. PropSheet_PressButton(GetParent(hDlg),PSBTN_CANCEL);
  508. SetPropSheetResult(hDlg,-1);
  509. return TRUE;
  510. }
  511. // set next page, only if 'next' or 'back' button
  512. // was pressed
  513. if (lpnm->code != PSN_WIZFINISH)
  514. {
  515. // set the next current page index
  516. gpWizardState->uCurrentPage = iNextPage;
  517. TraceMsg(TF_GENDLG, "GENDLG: going to page %d (IDD %d)", iNextPage, GetDlgIDFromIndex(iNextPage));
  518. // tell the prop sheet mgr what the next page to
  519. // display is
  520. SetPropSheetResult(hDlg,GetDlgIDFromIndex(iNextPage));
  521. return TRUE;
  522. }
  523. break;
  524. case PSN_QUERYCANCEL:
  525. // if global flag to exit is set, then this cancel
  526. // is us pretending to push 'cancel' so prop page mgr
  527. // will kill the wizard. Let this through...
  528. if (gfQuitWizard)
  529. {
  530. SetWindowLongPtr(hDlg,DWLP_MSGRESULT,FALSE);
  531. return TRUE;
  532. }
  533. //Dialing is a super special case cuz we wanna skip all the UI and
  534. //go striaght to a dialing error page
  535. if (gpWizardState->uCurrentPage == ORD_PAGE_ISPDIAL)
  536. {
  537. gfISPDialCancel = TRUE;
  538. gfUserCancelled = TRUE; // Just in case
  539. PropSheet_PressButton(GetParent(hDlg),PSBTN_NEXT);
  540. // if this page has a special cancel proc, call it
  541. if (pPageInfo->CancelProc)
  542. {
  543. SetWindowLongPtr(hDlg,DWLP_MSGRESULT,pPageInfo->CancelProc(hDlg));
  544. SetEvent(gpWizardState->hEventWebGateDone);
  545. }
  546. }
  547. else
  548. {
  549. // default behavior: pop up a message box confirming
  550. // the cancel...
  551. // ... unless we're serving as an Apprentice, in which case
  552. // we should let the Wizard handle things
  553. fRet = (MsgBox(hDlg,IDS_QUERYCANCEL,
  554. MB_ICONQUESTION,MB_YESNO |
  555. MB_DEFBUTTON2) == IDYES);
  556. gfUserCancelled = fRet;
  557. if (gfUserCancelled)
  558. {
  559. // if this page has a special cancel proc, call it
  560. if (pPageInfo->CancelProc)
  561. fRet = pPageInfo->CancelProc(hDlg);
  562. SetEvent(gpWizardState->hEventWebGateDone);
  563. }
  564. // return the value thru window data
  565. SetWindowLongPtr(hDlg,DWLP_MSGRESULT,!fRet);
  566. }
  567. return TRUE;
  568. break;
  569. default:
  570. // See if the page has a notify proc
  571. if (pPageInfo->NotifyProc)
  572. {
  573. pPageInfo->NotifyProc(hDlg,wParam,lParam);
  574. }
  575. break;
  576. }
  577. break;
  578. }
  579. case WM_COMMAND:
  580. {
  581. // if this page has a command handler proc, call it
  582. if (pPageInfo->CmdProc)
  583. {
  584. pPageInfo->CmdProc(hDlg, wParam, lParam);
  585. }
  586. }
  587. }
  588. return FALSE;
  589. }