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.

128 lines
4.2 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994 **
  4. //*********************************************************************
  5. //
  6. // BILLOPT.CPP - Functions for
  7. //
  8. // HISTORY:
  9. //
  10. // 05/13/98 donaldm Created.
  11. //
  12. //*********************************************************************
  13. #include "pre.h"
  14. const TCHAR cszBillOpt[] = TEXT("BILLOPT");
  15. /*******************************************************************
  16. NAME: BillingOptInitProc
  17. SYNOPSIS: Called when page is displayed
  18. ENTRY: hDlg - dialog window
  19. fFirstInit - TRUE if this is the first time the dialog
  20. is initialized, FALSE if this InitProc has been called
  21. before (e.g. went past this page and backed up)
  22. ********************************************************************/
  23. BOOL CALLBACK BillingOptInitProc
  24. (
  25. HWND hDlg,
  26. BOOL fFirstInit,
  27. UINT *puNextPage
  28. )
  29. {
  30. // if we've travelled through external apprentice pages,
  31. // it's easy for our current page pointer to get munged,
  32. // so reset it here for sanity's sake.
  33. gpWizardState->uCurrentPage = ORD_PAGE_BILLINGOPT;
  34. if (!fFirstInit)
  35. {
  36. ASSERT(gpWizardState->lpSelectedISPInfo);
  37. gpWizardState->lpSelectedISPInfo->DisplayTextWithISPName(GetDlgItem(hDlg,IDC_BILLINGOPT_INTRO), IDS_BILLINGOPT_INTROFMT, NULL);
  38. gpWizardState->pICWWebView->ConnectToWindow(GetDlgItem(hDlg, IDC_BILLINGOPT_HTML), PAGETYPE_BILLING);
  39. // Navigate to the Billing HTML
  40. gpWizardState->lpSelectedISPInfo->DisplayHTML(gpWizardState->lpSelectedISPInfo->get_szBillingFormPath());
  41. // Load any previsouly saved state data for this page
  42. gpWizardState->lpSelectedISPInfo->LoadHistory((BSTR)A2W(cszBillOpt));
  43. }
  44. return TRUE;
  45. }
  46. /*******************************************************************
  47. NAME: BillingOptOKProc
  48. SYNOPSIS: Called when Next or Back btns pressed from page
  49. ENTRY: hDlg - dialog window
  50. fForward - TRUE if 'Next' was pressed, FALSE if 'Back'
  51. puNextPage - if 'Next' was pressed,
  52. proc can fill this in with next page to go to. This
  53. parameter is ingored if 'Back' was pressed.
  54. pfKeepHistory - page will not be kept in history if
  55. proc fills this in with FALSE.
  56. EXIT: returns TRUE to allow page to be turned, FALSE
  57. to keep the same page.
  58. ********************************************************************/
  59. BOOL CALLBACK BillingOptOKProc
  60. (
  61. HWND hDlg,
  62. BOOL fForward,
  63. UINT *puNextPage,
  64. BOOL *pfKeepHistory
  65. )
  66. {
  67. // Save any data data/state entered by the user
  68. gpWizardState->lpSelectedISPInfo->SaveHistory((BSTR)A2W(cszBillOpt));
  69. if (fForward)
  70. {
  71. // Need to form Billing Query String
  72. TCHAR szBillingOptionQuery [INTERNET_MAX_URL_LENGTH];
  73. // Clear the Query String.
  74. memset(szBillingOptionQuery, 0, sizeof(szBillingOptionQuery));
  75. // Attach the walker to the curent page
  76. // Use the Walker to get the query string
  77. IWebBrowser2 *lpWebBrowser;
  78. gpWizardState->pICWWebView->get_BrowserObject(&lpWebBrowser);
  79. gpWizardState->pHTMLWalker->AttachToDocument(lpWebBrowser);
  80. gpWizardState->pHTMLWalker->get_FirstFormQueryString(szBillingOptionQuery);
  81. // Add the billing query to the ISPData object
  82. gpWizardState->pISPData->PutDataElement(ISPDATA_BILLING_OPTION, szBillingOptionQuery, ISPDATA_Validate_None);
  83. // detach the walker
  84. gpWizardState->pHTMLWalker->Detach();
  85. DWORD dwFlag = gpWizardState->lpSelectedISPInfo->get_dwCFGFlag();
  86. if (ICW_CFGFLAG_SIGNUP_PATH & dwFlag)
  87. {
  88. if (ICW_CFGFLAG_PAYMENT & dwFlag)
  89. {
  90. *puNextPage = ORD_PAGE_PAYMENT;
  91. return TRUE;
  92. }
  93. *puNextPage = ORD_PAGE_ISPDIAL;
  94. return TRUE;
  95. }
  96. }
  97. return TRUE;
  98. }