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.

405 lines
9.4 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. // All rights reserved.
  5. //
  6. // File Name:
  7. // tapi.c
  8. //
  9. // Description:
  10. // This file contains the dialog procedure for the Internet Explorer page.
  11. // (IDD_IE).
  12. //
  13. //----------------------------------------------------------------------------
  14. #include "pch.h"
  15. #include "resource.h"
  16. //
  17. // Prototype for the dialog procs that launch from the buttons on the IE page.
  18. //
  19. INT_PTR CALLBACK CustomSettingsDlg(
  20. IN HWND hwnd,
  21. IN UINT uMsg,
  22. IN WPARAM wParam,
  23. IN LPARAM lParam );
  24. INT_PTR CALLBACK ProxySettingsDlg(
  25. IN HWND hwnd,
  26. IN UINT uMsg,
  27. IN WPARAM wParam,
  28. IN LPARAM lParam );
  29. INT_PTR CALLBACK BrowserSettingsDlg(
  30. IN HWND hwnd,
  31. IN UINT uMsg,
  32. IN WPARAM wParam,
  33. IN LPARAM lParam );
  34. //----------------------------------------------------------------------------
  35. //
  36. // Function: GreyUnGreyIe
  37. //
  38. // Purpose:
  39. //
  40. // Arguments: IN HWND hwnd - handle to the dialog box
  41. //
  42. // Returns: VOID
  43. //
  44. //----------------------------------------------------------------------------
  45. static VOID
  46. GreyUnGreyIe( IN HWND hwnd )
  47. {
  48. BOOL bGreyCustom;
  49. BOOL bGreySpecify;
  50. if( IsDlgButtonChecked( hwnd, IDC_RAD_DEFAULT_IE ) )
  51. {
  52. bGreyCustom = FALSE;
  53. bGreySpecify = FALSE;
  54. }
  55. else if( IsDlgButtonChecked( hwnd, IDC_RAD_AUTOCONFIG ) )
  56. {
  57. bGreyCustom = TRUE;
  58. bGreySpecify = FALSE;
  59. }
  60. else if( IsDlgButtonChecked( hwnd, IDC_RAD_SPECIFY ) )
  61. {
  62. bGreyCustom = FALSE;
  63. bGreySpecify = TRUE;
  64. }
  65. else
  66. {
  67. bGreyCustom = FALSE;
  68. bGreySpecify = FALSE;
  69. }
  70. EnableWindow( GetDlgItem( hwnd, IDC_CUSTOMIZE_TEXT ), bGreyCustom );
  71. EnableWindow( GetDlgItem( hwnd, IDC_BUT_CUSTOM_SETTINGS ), bGreyCustom );
  72. EnableWindow( GetDlgItem( hwnd, IDC_PROXY_TEXT ), bGreySpecify );
  73. EnableWindow( GetDlgItem( hwnd, IDC_BUT_PROXY_SETTINGS ), bGreySpecify );
  74. EnableWindow( GetDlgItem( hwnd, IDC_HOMEPAGE_TEXT ), bGreySpecify );
  75. EnableWindow( GetDlgItem( hwnd, IDC_BUT_BROWSER_SETTINGS ), bGreySpecify );
  76. }
  77. //----------------------------------------------------------------------------
  78. //
  79. // Function: OnRadioButtonIe
  80. //
  81. // Purpose: Called when a radio button is pushed. Grey/ungrey controls.
  82. //
  83. // Arguments: IN HWND hwnd - handle to the dialog box
  84. // IN INT nButtonId - the radio button to check
  85. //
  86. // Returns: VOID
  87. //
  88. //----------------------------------------------------------------------------
  89. static VOID
  90. OnRadioButtonIe( IN HWND hwnd, IN INT nButtonId )
  91. {
  92. CheckRadioButton( hwnd,
  93. IDC_RAD_DEFAULT_IE,
  94. IDC_RAD_SPECIFY,
  95. nButtonId );
  96. GreyUnGreyIe( hwnd );
  97. }
  98. //----------------------------------------------------------------------------
  99. //
  100. // Function: OnCustomIe
  101. //
  102. // Purpose:
  103. //
  104. // Arguments: IN HWND hwnd - handle to the dialog box
  105. //
  106. // Returns: VOID
  107. //
  108. //----------------------------------------------------------------------------
  109. static VOID
  110. OnCustomIe( IN HWND hwnd )
  111. {
  112. DialogBox( FixedGlobals.hInstance,
  113. MAKEINTRESOURCE(IDD_IE_CUSTOM),
  114. hwnd,
  115. CustomSettingsDlg );
  116. }
  117. //----------------------------------------------------------------------------
  118. //
  119. // Function: OnProxyIe
  120. //
  121. // Purpose:
  122. //
  123. // Arguments: IN HWND hwnd - handle to the dialog box
  124. //
  125. // Returns: VOID
  126. //
  127. //----------------------------------------------------------------------------
  128. static VOID
  129. OnProxyIe( IN HWND hwnd )
  130. {
  131. DialogBox( FixedGlobals.hInstance,
  132. MAKEINTRESOURCE(IDD_IE_PROXY),
  133. hwnd,
  134. ProxySettingsDlg );
  135. }
  136. //----------------------------------------------------------------------------
  137. //
  138. // Function: OnBrowserIe
  139. //
  140. // Purpose:
  141. //
  142. // Arguments: IN HWND hwnd - handle to the dialog box
  143. //
  144. // Returns: VOID
  145. //
  146. //----------------------------------------------------------------------------
  147. static VOID
  148. OnBrowserIe( IN HWND hwnd )
  149. {
  150. //
  151. // If user hits ok, store the proxy settings the user entered
  152. //
  153. if( DialogBox( FixedGlobals.hInstance,
  154. MAKEINTRESOURCE(IDD_IE_BROWSER),
  155. hwnd,
  156. BrowserSettingsDlg ) )
  157. {
  158. // StoreBrowserSettings( hwnd );
  159. }
  160. }
  161. //----------------------------------------------------------------------------
  162. //
  163. // Function: OnIeInitDialog
  164. //
  165. // Purpose:
  166. //
  167. // Arguments: IN HWND hwnd - handle to the dialog box
  168. //
  169. // Returns: VOID
  170. //
  171. //----------------------------------------------------------------------------
  172. static VOID
  173. OnIeInitDialog( IN HWND hwnd )
  174. {
  175. }
  176. //----------------------------------------------------------------------------
  177. //
  178. // Function: OnIeSetActive
  179. //
  180. // Purpose:
  181. //
  182. // Arguments: IN HWND hwnd - handle to the dialog box
  183. //
  184. // Returns: VOID
  185. //
  186. //----------------------------------------------------------------------------
  187. static VOID
  188. OnIeSetActive( IN HWND hwnd )
  189. {
  190. int nButtonId;
  191. if( GenSettings.IeCustomizeMethod == IE_NO_CUSTOMIZATION )
  192. {
  193. nButtonId = IDC_RAD_DEFAULT_IE;
  194. }
  195. else if( GenSettings.IeCustomizeMethod == IE_USE_BRANDING_FILE )
  196. {
  197. nButtonId = IDC_RAD_AUTOCONFIG;
  198. }
  199. else if( GenSettings.IeCustomizeMethod == IE_SPECIFY_SETTINGS )
  200. {
  201. nButtonId = IDC_RAD_SPECIFY;
  202. }
  203. else
  204. {
  205. nButtonId = IDC_RAD_DEFAULT_IE;
  206. }
  207. CheckRadioButton( hwnd,
  208. IDC_RAD_DEFAULT_IE,
  209. IDC_RAD_SPECIFY,
  210. nButtonId );
  211. GreyUnGreyIe( hwnd );
  212. WIZ_BUTTONS(hwnd , PSWIZB_BACK | PSWIZB_NEXT);
  213. }
  214. //----------------------------------------------------------------------------
  215. //
  216. // Function: OnWizNextIe
  217. //
  218. // Purpose:
  219. //
  220. // Arguments: IN HWND hwnd - handle to the dialog box
  221. //
  222. // Returns: VOID
  223. //
  224. //----------------------------------------------------------------------------
  225. static VOID
  226. OnWizNextIe( IN HWND hwnd )
  227. {
  228. if( IsDlgButtonChecked( hwnd, IDC_RAD_DEFAULT_IE ) )
  229. {
  230. GenSettings.IeCustomizeMethod = IE_NO_CUSTOMIZATION;
  231. }
  232. else if( IsDlgButtonChecked( hwnd, IDC_RAD_AUTOCONFIG ) )
  233. {
  234. GenSettings.IeCustomizeMethod = IE_USE_BRANDING_FILE;
  235. }
  236. else if( IsDlgButtonChecked( hwnd, IDC_RAD_SPECIFY ) )
  237. {
  238. GenSettings.IeCustomizeMethod = IE_SPECIFY_SETTINGS;
  239. }
  240. else
  241. {
  242. GenSettings.IeCustomizeMethod = IE_NO_CUSTOMIZATION;
  243. }
  244. }
  245. //----------------------------------------------------------------------------
  246. //
  247. // Function: DlgIePage
  248. //
  249. // Purpose:
  250. //
  251. // Arguments: standard Win32 dialog proc arguments
  252. //
  253. // Returns: standard Win32 dialog proc return value -- whether the message
  254. // was handled or not
  255. //
  256. //----------------------------------------------------------------------------
  257. INT_PTR CALLBACK
  258. DlgIePage( IN HWND hwnd,
  259. IN UINT uMsg,
  260. IN WPARAM wParam,
  261. IN LPARAM lParam)
  262. {
  263. BOOL bStatus = TRUE;
  264. switch( uMsg ) {
  265. case WM_INITDIALOG: {
  266. OnIeInitDialog( hwnd );
  267. break;
  268. }
  269. case WM_COMMAND:
  270. {
  271. int nButtonId=LOWORD(wParam);
  272. switch ( nButtonId ) {
  273. case IDC_RAD_AUTOCONFIG:
  274. case IDC_RAD_DEFAULT_IE:
  275. case IDC_RAD_SPECIFY:
  276. if( HIWORD( wParam ) == BN_CLICKED )
  277. OnRadioButtonIe( hwnd, nButtonId );
  278. break;
  279. case IDC_BUT_CUSTOM_SETTINGS:
  280. if( HIWORD(wParam) == BN_CLICKED )
  281. OnCustomIe(hwnd);
  282. break;
  283. case IDC_BUT_PROXY_SETTINGS:
  284. if( HIWORD(wParam) == BN_CLICKED )
  285. OnProxyIe(hwnd);
  286. break;
  287. case IDC_BUT_BROWSER_SETTINGS:
  288. if( HIWORD(wParam) == BN_CLICKED )
  289. OnBrowserIe(hwnd);
  290. break;
  291. default:
  292. bStatus = FALSE;
  293. break;
  294. }
  295. break;
  296. }
  297. case WM_NOTIFY: {
  298. LPNMHDR pnmh = (LPNMHDR)lParam;
  299. switch( pnmh->code ) {
  300. case PSN_QUERYCANCEL:
  301. WIZ_CANCEL(hwnd);
  302. break;
  303. case PSN_SETACTIVE: {
  304. g_App.dwCurrentHelp = IDH_BROW_SHELL;
  305. OnIeSetActive( hwnd );
  306. break;
  307. }
  308. case PSN_WIZBACK:
  309. bStatus = FALSE;
  310. break;
  311. case PSN_WIZNEXT:
  312. OnWizNextIe( hwnd );
  313. bStatus = FALSE;
  314. break;
  315. case PSN_HELP:
  316. WIZ_HELP();
  317. break;
  318. default:
  319. break;
  320. }
  321. break;
  322. }
  323. default:
  324. bStatus = FALSE;
  325. break;
  326. }
  327. return( bStatus );
  328. }