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.

287 lines
7.1 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. Swconfig.H
  5. Abstract:
  6. Select Installation type Dialog Box Procedures
  7. Author:
  8. Bob Watson (a-robw)
  9. Revision History:
  10. 17 Feb 94 Written
  11. --*/
  12. //
  13. // Windows Include Files
  14. //
  15. #include <windows.h>
  16. #include <stdio.h>
  17. #include <malloc.h>
  18. #include <tchar.h> // unicode macros
  19. //
  20. // app include files
  21. //
  22. #include "otnboot.h"
  23. #include "otnbtdlg.h"
  24. #ifdef TERMSRV
  25. extern TCHAR szCommandLineVal[MAX_PATH];
  26. #endif // TERMSRV
  27. static
  28. BOOL
  29. SwConfigDlg_WM_INITDIALOG (
  30. IN HWND hwndDlg,
  31. IN WPARAM wParam,
  32. IN LPARAM lParam
  33. )
  34. /*++
  35. Routine Description:
  36. Process the WM_INITDIALOG windows message. Initialized the
  37. values in the dialog box controls to reflect the current
  38. values of the Application data structure.
  39. Arguments:
  40. IN HWND hwndDlg
  41. handle to dialog box window
  42. IN WPARAM wParam
  43. Not Used
  44. IN LPARAM lParam
  45. Not Used
  46. Return Value:
  47. FALSE
  48. --*/
  49. {
  50. // configure window & initialize variables
  51. RemoveMaximizeFromSysMenu (hwndDlg);
  52. RegCloseKey (pAppInfo->hkeyMachine);
  53. pAppInfo->hkeyMachine = NULL;
  54. PositionWindow (hwndDlg);
  55. // set default configuration button
  56. if (pAppInfo->itInstall == OverTheNetInstall) {
  57. CheckRadioButton (hwndDlg, NCDU_OVER_THE_NET, NCDU_REMOTEBOOT_INFO,
  58. NCDU_OVER_THE_NET);
  59. } else if (pAppInfo->itInstall == FloppyDiskInstall) {
  60. CheckRadioButton (hwndDlg, NCDU_OVER_THE_NET, NCDU_REMOTEBOOT_INFO,
  61. NCDU_FLOPPY_INSTALL);
  62. } else if (pAppInfo->itInstall == CopyNetAdminUtils) {
  63. CheckRadioButton (hwndDlg, NCDU_OVER_THE_NET, NCDU_REMOTEBOOT_INFO,
  64. NCDU_COPY_NET_ADMIN_UTILS);
  65. } else if (pAppInfo->itInstall == ShowRemoteBootInfo) {
  66. CheckRadioButton (hwndDlg, NCDU_OVER_THE_NET, NCDU_REMOTEBOOT_INFO,
  67. NCDU_REMOTEBOOT_INFO);
  68. }
  69. PostMessage (GetParent(hwndDlg), NCDU_CLEAR_DLG, (WPARAM)hwndDlg, IDOK);
  70. PostMessage (GetParent(hwndDlg), NCDU_REGISTER_DLG,
  71. NCDU_SW_CONFIG_DLG, (LPARAM)hwndDlg);
  72. SetCursor(LoadCursor(NULL, IDC_ARROW));
  73. SetFocus (GetDlgItem(hwndDlg, IDOK));
  74. return FALSE;
  75. }
  76. static
  77. BOOL
  78. SwConfigDlg_IDOK (
  79. IN HWND hwndDlg
  80. )
  81. /*++
  82. Routine Description:
  83. Processes the IDOK button click. Validates the entries and looks up
  84. the distribution path to try and translate it to a UNC path.
  85. Then ends the dialog and calls the next dialog box.
  86. Arguments:
  87. IN HWND hwndDlg
  88. handle to the dialog box window
  89. Return Value:
  90. FALSE
  91. --*/
  92. {
  93. UINT nNextMessage = 0;
  94. BOOL bValidate = TRUE;
  95. UINT nValidMsg = 0;
  96. if (IsDlgButtonChecked(hwndDlg,NCDU_OVER_THE_NET) == CHECKED) {
  97. pAppInfo->itInstall = OverTheNetInstall;
  98. nNextMessage = (int)NCDU_SHOW_SHARE_NET_SW_DLG;
  99. } else if (IsDlgButtonChecked(hwndDlg,NCDU_FLOPPY_INSTALL) == CHECKED) {
  100. pAppInfo->itInstall = FloppyDiskInstall;
  101. nNextMessage = (int)NCDU_SHOW_SHARE_NET_SW_DLG;
  102. } else if (IsDlgButtonChecked(hwndDlg,NCDU_COPY_NET_ADMIN_UTILS) == CHECKED) {
  103. pAppInfo->itInstall = CopyNetAdminUtils;
  104. nNextMessage = (int)NCDU_SHOW_COPY_ADMIN_UTILS;
  105. } else if (IsDlgButtonChecked(hwndDlg,NCDU_REMOTEBOOT_INFO) == CHECKED) {
  106. pAppInfo->itInstall = ShowRemoteBootInfo;
  107. DisplayMessageBox (
  108. hwndDlg,
  109. NCDU_LANMAN_MESSAGE,
  110. 0,
  111. MB_OK_TASK_INFO);
  112. nNextMessage = (int)NCDU_SHOW_SW_CONFIG_DLG;
  113. }
  114. PostMessage (GetParent(hwndDlg), nNextMessage, 0, 0);
  115. SetCursor(LoadCursor(NULL, IDC_WAIT));
  116. return TRUE;
  117. }
  118. static
  119. BOOL
  120. SwConfigDlg_NCDU_EXIT (
  121. IN HWND hwndDlg
  122. )
  123. /*++
  124. Routine Description:
  125. ends the dialog box (and ultimately the app)
  126. Arguments:
  127. IN HWND hwndDlg
  128. Return Value:
  129. FALSE
  130. --*/
  131. {
  132. PostMessage (GetParent(hwndDlg), (int)NCDU_SHOW_EXIT_MESSAGE_DLG, 0, 0);
  133. SetCursor(LoadCursor(NULL, IDC_WAIT));
  134. return TRUE;
  135. }
  136. static
  137. BOOL
  138. SwConfigDlg_WM_COMMAND (
  139. IN HWND hwndDlg,
  140. IN WPARAM wParam,
  141. IN LPARAM lParam
  142. )
  143. /*++
  144. Routine Description:
  145. Processes the WM_COMMAND windows message and dispatches to
  146. the routine that corresponds to the control issuing the
  147. message.
  148. Arguments:
  149. IN HWND hwndDlg
  150. Handle to dialog box window
  151. IN WPARAM wParam
  152. LOWORD has ID of control initiating the message
  153. IN LPARAM lParam
  154. Not Used
  155. Return Value:
  156. TRUE if message not processed by this routine, otherwise the
  157. value of the dispatched routine .
  158. --*/
  159. {
  160. switch (LOWORD(wParam)) {
  161. case NCDU_EXIT: return SwConfigDlg_NCDU_EXIT (hwndDlg);
  162. case IDOK: return SwConfigDlg_IDOK (hwndDlg);
  163. case NCDU_SW_CONFIG_HELP:
  164. switch (HIWORD(wParam)) {
  165. case BN_CLICKED:
  166. // return ShowAppHelp (hwndDlg, LOWORD(wParam));
  167. return PostMessage (GetParent(hwndDlg), WM_HOTKEY,
  168. (WPARAM)NCDU_HELP_HOT_KEY, 0);
  169. default:
  170. return FALSE;
  171. }
  172. default: return FALSE;
  173. }
  174. }
  175. INT_PTR CALLBACK
  176. SwConfigDlgProc (
  177. IN HWND hwndDlg,
  178. IN UINT message,
  179. IN WPARAM wParam,
  180. IN LPARAM lParam
  181. )
  182. /*++
  183. Routine Description:
  184. Main Dialog Box Window Procedure for the Initial configuration screen
  185. Processes the following windows messages by dispatching the
  186. appropriate routine.
  187. WM_INITDIALOG: dialog box initialization
  188. WM_COMMAND: user input
  189. WM_PAINT: for painting icon when minimized
  190. WM_MOVE: for saving the new location of the window
  191. WM_SYSCOMMAND: for processing menu messages
  192. All other windows messages are processed by the default dialog box
  193. procedure.
  194. Arguments:
  195. Standard WNDPROC arguments
  196. Return Value:
  197. FALSE if the message is not processed by this routine, otherwise the
  198. value returned by the dispatched routine.
  199. --*/
  200. {
  201. switch (message) {
  202. #ifdef TERMSRV
  203. case WM_INITDIALOG: if ( szCommandLineVal[0] != 0x00 ) {
  204. SwConfigDlg_WM_INITDIALOG (hwndDlg, wParam, lParam);
  205. CheckRadioButton (hwndDlg, NCDU_OVER_THE_NET, NCDU_REMOTEBOOT_INFO,
  206. NCDU_FLOPPY_INSTALL);
  207. SwConfigDlg_IDOK (hwndDlg);
  208. return FALSE;
  209. }
  210. else
  211. return (SwConfigDlg_WM_INITDIALOG (hwndDlg, wParam, lParam));
  212. #else // TERMSRV
  213. case WM_INITDIALOG: return (SwConfigDlg_WM_INITDIALOG (hwndDlg, wParam, lParam));
  214. #endif // TERMSRV
  215. case WM_COMMAND: return (SwConfigDlg_WM_COMMAND (hwndDlg, wParam, lParam));
  216. case WM_PAINT: return (Dlg_WM_PAINT (hwndDlg, wParam, lParam));
  217. case WM_MOVE: return (Dlg_WM_MOVE (hwndDlg, wParam, lParam));
  218. case WM_SYSCOMMAND: return (Dlg_WM_SYSCOMMAND (hwndDlg, wParam, lParam));
  219. default: return FALSE;
  220. }
  221. }