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.

143 lines
4.0 KiB

  1. #include "faxcfgwz.h"
  2. INT_PTR CALLBACK
  3. WelcomeDlgProc (
  4. HWND hDlg,
  5. UINT uMsg,
  6. WPARAM wParam,
  7. LPARAM lParam
  8. )
  9. /*++
  10. Routine Description:
  11. Procedure for handling the "Welcome" page
  12. Arguments:
  13. hDlg - Identifies the property sheet page
  14. uMsg - Specifies the message
  15. wParam - Specifies additional message-specific information
  16. lParam - Specifies additional message-specific information
  17. Return Value:
  18. Depends on the value of message parameter
  19. --*/
  20. {
  21. // Process messages from the Welcome page
  22. HWND hwndControl;
  23. #define WM_SETPAGEFOCUS WM_APP+2
  24. //
  25. // Property Sheet control id's (determined with Spy++)
  26. // Taken from MFC StdAfx.h
  27. //
  28. #define ID_WIZNEXT 0x3024
  29. switch (uMsg)
  30. {
  31. case WM_INITDIALOG :
  32. {
  33. TCHAR szText[1024] = {0}; // text for "Link Window"
  34. TCHAR szTemp[1024] = {0};
  35. // Get the shared data from PROPSHEETPAGE lParam value
  36. // and load it into GWL_USERDATA
  37. // It's an intro/end page, so get the title font
  38. // from the shared data and use it for the title control
  39. Assert(g_wizData.hTitleFont);
  40. hwndControl = GetDlgItem(hDlg, IDCSTATIC_WELCOME_TITLE);
  41. SetWindowFont(hwndControl, g_wizData.hTitleFont, TRUE);
  42. // if there are more than one device, we'll show a warning that the wizard can
  43. // only config the devices into same settings.
  44. // will do it later.
  45. if((g_wizData.dwDeviceCount > 1) && !IsDesktopSKU())
  46. {
  47. // if error, we will not show the warning message.
  48. if(GetDlgItemText(hDlg, IDC_ADMINCONSOLE_LINK, szText, MAX_STRING_LEN))
  49. {
  50. if(!LoadString(g_hResource, IDS_ADMIN_CONSOLE_LINK, szTemp, MAX_PATH - 1))
  51. {
  52. DEBUG_FUNCTION_NAME(TEXT("WelcomeDlgProc()"));
  53. DebugPrintEx(DEBUG_ERR,
  54. TEXT("LoadString failed: string ID=%d, error=%d"),
  55. IDS_ADMIN_CONSOLE_LINK,
  56. GetLastError());
  57. Assert(FALSE);
  58. }
  59. else
  60. {
  61. _tcsncat(szText, szTemp, ARR_SIZE(szText) - _tcslen(szText)-1);
  62. SetDlgItemText(hDlg, IDC_ADMINCONSOLE_LINK, szText);
  63. }
  64. }
  65. }
  66. PostMessage(hDlg, WM_SETPAGEFOCUS, 0, 0L);
  67. return TRUE;
  68. }
  69. case WM_SETPAGEFOCUS:
  70. {
  71. //
  72. // Set Focus on the Next button
  73. //
  74. HWND hNextButton = GetDlgItem(GetParent(hDlg), ID_WIZNEXT);
  75. if(hNextButton)
  76. {
  77. SetFocus(hNextButton);
  78. }
  79. break;
  80. }
  81. case WM_NOTIFY :
  82. {
  83. LPNMHDR lpnm = (LPNMHDR) lParam;
  84. switch (lpnm->code)
  85. {
  86. case PSN_SETACTIVE : //Enable the Next button
  87. PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT);
  88. PostMessage(hDlg, WM_SETPAGEFOCUS, 0, 0L);
  89. break;
  90. case PSN_WIZNEXT :
  91. //
  92. // Handle a Next button click here
  93. //
  94. SetLastPage(IDD_CFG_WIZARD_WELCOME);
  95. break;
  96. case PSN_RESET :
  97. break;
  98. case NM_RETURN:
  99. case NM_CLICK:
  100. if( IDC_ADMINCONSOLE_LINK == lpnm->idFrom )
  101. {
  102. InvokeServiceManager(hDlg, g_hResource, IDS_ADMIN_CONSOLE_TITLE);
  103. }
  104. break;
  105. default :
  106. break;
  107. }
  108. }
  109. break;
  110. default:
  111. break;
  112. }
  113. return FALSE;
  114. }