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.

132 lines
3.7 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994 **
  4. //*********************************************************************
  5. //
  6. // MULTINUM.CPP - Functions for final Wizard pages
  7. //
  8. // HISTORY:
  9. //
  10. // 05/28/98 donaldm created
  11. //
  12. //*********************************************************************
  13. #include "pre.h"
  14. /*******************************************************************
  15. NAME: InitListBox
  16. SYNOPSIS: Initialize the phone number list view
  17. ENTRY: hListBox - handle to the list view window
  18. EXIT: returns TRUE when successful, FALSE otherwise.
  19. ********************************************************************/
  20. BOOL InitListBox(HWND hListBox)
  21. {
  22. LONG lNumDevice;
  23. LONG i;
  24. gpWizardState->pRefDial->get_PhoneNumberEnum_NumDevices(&lNumDevice);
  25. if (lNumDevice > 0)
  26. {
  27. for (i=0; i < lNumDevice; i++)
  28. {
  29. BSTR bstr = NULL;
  30. gpWizardState->pRefDial->PhoneNumberEnum_Next(&bstr);
  31. if (bstr != NULL)
  32. {
  33. ListBox_InsertString(hListBox, i, W2A(bstr));
  34. SysFreeString(bstr);
  35. }
  36. }
  37. ListBox_SetCurSel(hListBox, 0);
  38. }
  39. return(TRUE);
  40. }
  41. /*******************************************************************
  42. NAME: MultiNumberInitProc
  43. SYNOPSIS: Called when page is displayed
  44. ENTRY: hDlg - dialog window
  45. fFirstInit - TRUE if this is the first time the dialog
  46. is initialized, FALSE if this InitProc has been called
  47. before (e.g. went past this page and backed up)
  48. ********************************************************************/
  49. BOOL CALLBACK MultiNumberInitProc
  50. (
  51. HWND hDlg,
  52. BOOL fFirstInit,
  53. UINT *puNextPage
  54. )
  55. {
  56. BOOL bRet = TRUE;
  57. if (fFirstInit)
  58. {
  59. InitListBox(GetDlgItem(hDlg, IDC_MULTIPHONE_LIST) );
  60. }
  61. else
  62. {
  63. // if we've travelled through external apprentice pages,
  64. // it's easy for our current page pointer to get munged,
  65. // so reset it here for sanity's sake.
  66. gpWizardState->uCurrentPage = ORD_PAGE_MULTINUMBER;
  67. }
  68. return bRet;
  69. }
  70. /*******************************************************************
  71. NAME: MultiNumberOKProc
  72. SYNOPSIS: Called when Next or Back btns pressed from page
  73. ENTRY: hDlg - dialog window
  74. fForward - TRUE if 'Next' was pressed, FALSE if 'Back'
  75. puNextPage - if 'Next' was pressed,
  76. proc can fill this in with next page to go to. This
  77. parameter is ingored if 'Back' was pressed.
  78. pfKeepHistory - page will not be kept in history if
  79. proc fills this in with FALSE.
  80. EXIT: returns TRUE to allow page to be turned, FALSE
  81. to keep the same page.
  82. ********************************************************************/
  83. BOOL CALLBACK MultiNumberOKProc
  84. (
  85. HWND hDlg,
  86. BOOL fForward,
  87. UINT *puNextPage,
  88. BOOL *pfKeepHistory
  89. )
  90. {
  91. ASSERT(puNextPage);
  92. if (fForward)
  93. {
  94. BOOL bRetVal = FALSE;
  95. // Do not go to this page when backing up
  96. *pfKeepHistory = FALSE;
  97. *puNextPage = ORD_PAGE_REFSERVDIAL;
  98. gpWizardState->lSelectedPhoneNumber = ListBox_GetCurSel(GetDlgItem(hDlg, IDC_MULTIPHONE_LIST));
  99. }
  100. else
  101. //FIX -- RAID: 33413
  102. //if the user is backing out of this page we must act as if no
  103. //number was ever selected.
  104. gpWizardState->bDoUserPick = FALSE;
  105. return TRUE;
  106. }