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.

151 lines
4.9 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. #include <assert.h>
  3. #include "precomp.h"
  4. void MoveCaret(int nID, HWND hwnd ) ;
  5. void SetDeleteKeyStatus(int iValue) ;
  6. LRW_DLG_INT CALLBACK
  7. WWWLKPProc(
  8. IN HWND hwnd,
  9. IN UINT uMsg,
  10. IN WPARAM wParam,
  11. IN LPARAM lParam
  12. )
  13. {
  14. DWORD dwNextPage = 0;
  15. BOOL bStatus = TRUE;
  16. PageInfo *pi = (PageInfo *)LRW_GETWINDOWLONG( hwnd, LRW_GWL_USERDATA );
  17. HWND hwndLSID;
  18. DWORD dwRetCode;
  19. TCHAR * cwRegistrationID;
  20. TCHAR awBuffer[ 128];
  21. TCHAR tcUserValue[ CHARS_IN_BATCH*NUMBER_OF_BATCHES + 1];
  22. // TCHAR szWWWInfo[512];
  23. // TCHAR szWWWInfoFormat[512];
  24. switch (uMsg)
  25. {
  26. case WM_INITDIALOG:
  27. pi = (PageInfo *)((LPPROPSHEETPAGE)lParam)->lParam;
  28. LRW_SETWINDOWLONG( hwnd, LRW_GWL_USERDATA, (LRW_LONG_PTR)pi );
  29. // Now set the Limit of the data entry fields
  30. // Now set the Limit of the data entry fields
  31. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO1, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  32. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO2, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  33. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO3, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  34. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO4, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  35. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO5, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  36. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO6, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  37. SendDlgItemMessage (hwnd, IDC_TXT_TELEINFO7, EM_SETLIMITTEXT, CHARS_IN_BATCH,0);
  38. assert(NUMBER_OF_BATCHES == 7);
  39. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO1), _T(""));
  40. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO2), _T(""));
  41. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO3), _T(""));
  42. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO4), _T(""));
  43. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO5), _T(""));
  44. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO6), _T(""));
  45. SetWindowText(GetDlgItem(hwnd, IDC_TXT_TELEINFO7), _T(""));
  46. break;
  47. case WM_DESTROY:
  48. LRW_SETWINDOWLONG( hwnd, LRW_GWL_USERDATA, NULL );
  49. break;
  50. case WM_COMMAND:
  51. if (HIWORD(wParam) == EN_CHANGE)
  52. {
  53. MoveCaret(LOWORD(wParam), hwnd ) ;
  54. }
  55. if (HIWORD(wParam) == EN_UPDATE)
  56. {
  57. if (GetKeyState(VK_DELETE) == -128)
  58. SetDeleteKeyStatus(1) ;
  59. else
  60. SetDeleteKeyStatus(0) ;
  61. }
  62. break ;
  63. case WM_NOTIFY:
  64. {
  65. LPNMHDR pnmh = (LPNMHDR)lParam;
  66. switch( pnmh->code )
  67. {
  68. case PSN_SETACTIVE:
  69. cwRegistrationID = GetGlobalContext()->GetRegistrationID();
  70. PropSheet_SetWizButtons( GetParent( hwnd ), PSWIZB_NEXT|PSWIZB_BACK);
  71. // Get the License Server ID, provided by the License Server
  72. hwndLSID = GetDlgItem(hwnd, IDC_MSID);
  73. swprintf(awBuffer, L"%5.5s-%5.5s-%5.5s-%5.5s-%5.5s-%5.5s-%5.5s",
  74. cwRegistrationID, cwRegistrationID + 5, cwRegistrationID + 10,
  75. cwRegistrationID + 15, cwRegistrationID + 20, cwRegistrationID + 25,
  76. cwRegistrationID + 30);
  77. SetWindowText(hwndLSID, awBuffer);
  78. SetDlgItemText(hwnd, IDC_WWWINFO, GetWWWSite());
  79. // Set WWW Info
  80. // LoadString(GetInstanceHandle(),IDS_WWWINFO, szWWWInfoFormat, sizeof(szWWWInfoFormat)/sizeof(TCHAR));
  81. // _stprintf(szWWWInfo,szWWWInfoFormat,GetWWWSite());
  82. // SetWindowText(GetDlgItem(hwnd, IDC_TXT_WWWINFO), szWWWInfo);
  83. break;
  84. case PSN_WIZNEXT:
  85. // Let us get the Information Entered First & concatenate everything into
  86. // One String
  87. GetDlgItemText(hwnd,IDC_TXT_TELEINFO1, tcUserValue, CHARS_IN_BATCH+1);
  88. GetDlgItemText(hwnd,IDC_TXT_TELEINFO2, tcUserValue+1*CHARS_IN_BATCH, CHARS_IN_BATCH+1);
  89. GetDlgItemText(hwnd,IDC_TXT_TELEINFO3, tcUserValue+2*CHARS_IN_BATCH, CHARS_IN_BATCH+1);
  90. GetDlgItemText(hwnd,IDC_TXT_TELEINFO4, tcUserValue+3*CHARS_IN_BATCH, CHARS_IN_BATCH+1);
  91. GetDlgItemText(hwnd,IDC_TXT_TELEINFO5, tcUserValue+4*CHARS_IN_BATCH, CHARS_IN_BATCH+1);
  92. GetDlgItemText(hwnd,IDC_TXT_TELEINFO6, tcUserValue+5*CHARS_IN_BATCH, CHARS_IN_BATCH+1);
  93. GetDlgItemText(hwnd,IDC_TXT_TELEINFO7, tcUserValue+6*CHARS_IN_BATCH, CHARS_IN_BATCH+1);
  94. // OK, Now we have the Information provided by the user
  95. // Need to validate
  96. dwRetCode = SetLSLKP(tcUserValue);
  97. if (dwRetCode != ERROR_SUCCESS)
  98. {
  99. LRMessageBox(hwnd, dwRetCode);
  100. dwNextPage = IDD_DLG_WWWLKP;
  101. }
  102. else
  103. {
  104. dwRetCode = ShowProgressBox(hwnd, ProcessThread, 0, 0, 0);
  105. dwNextPage = IDD_PROGRESS;
  106. LRPush(IDD_DLG_WWWLKP);
  107. }
  108. LRW_SETWINDOWLONG(hwnd, LRW_DWL_MSGRESULT, dwNextPage);
  109. bStatus = -1;
  110. break;
  111. case PSN_WIZBACK:
  112. dwNextPage = LRPop();
  113. LRW_SETWINDOWLONG(hwnd, LRW_DWL_MSGRESULT, dwNextPage);
  114. bStatus = -1;
  115. break;
  116. default:
  117. bStatus = FALSE;
  118. break;
  119. }
  120. }
  121. break;
  122. default:
  123. bStatus = FALSE;
  124. break;
  125. }
  126. return bStatus;
  127. }