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.

107 lines
3.4 KiB

  1. //-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: DLGBKUP.H
  7. //
  8. // Contents: Declaration for CIpBackUpDlg
  9. //
  10. // Notes: CIpBackUpDlg is the modal dialog to handle the fallback static
  11. // TCP/IP settings
  12. //
  13. // Author: nsun 02/15/2000
  14. //-----------------------------------------------------------------------
  15. #pragma once
  16. #include <ncxbase.h>
  17. #include <ncatlps.h>
  18. #include "ipctrl.h"
  19. // The IP Back up setting dialog
  20. class CIpBackUpDlg : public CPropSheetPage
  21. {
  22. public:
  23. BEGIN_MSG_MAP(CIpBackUpDlg)
  24. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog);
  25. MESSAGE_HANDLER(WM_DESTROY, OnDestroyDialog);
  26. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  27. MESSAGE_HANDLER(WM_HELP, OnHelp);
  28. // Property page notification message handlers
  29. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  30. NOTIFY_CODE_HANDLER(PSN_RESET, OnCancel)
  31. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  32. // command handlers
  33. COMMAND_ID_HANDLER(IDC_BKUP_RD_AUTO, OnAutoNet)
  34. COMMAND_ID_HANDLER(IDC_BKUP_RD_USER, OnUseConfig)
  35. COMMAND_ID_HANDLER(IDC_BKUP_IPADDR, OnIpctrl)
  36. COMMAND_ID_HANDLER(IDC_BKUP_SUBNET, OnIpAddrSub)
  37. COMMAND_ID_HANDLER(IDC_BKUP_GATEWAY, OnIpctrl)
  38. COMMAND_ID_HANDLER(IDC_BKUP_PREF_DNS, OnIpctrl)
  39. COMMAND_ID_HANDLER(IDC_BKUP_ALT_DNS, OnIpctrl)
  40. COMMAND_ID_HANDLER(IDC_BKUP_WINS1, OnIpctrl)
  41. COMMAND_ID_HANDLER(IDC_BKUP_WINS2, OnIpctrl)
  42. NOTIFY_CODE_HANDLER(IPN_FIELDCHANGED, OnIpFieldChange)
  43. END_MSG_MAP()
  44. //
  45. public:
  46. CIpBackUpDlg(CTcpipcfg * ptcpip,
  47. const DWORD* pamhidsHelp = NULL
  48. );
  49. ~CIpBackUpDlg();
  50. // Dialog creation overides
  51. public:
  52. // notify handlers for the property page
  53. LRESULT OnApply(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  54. LRESULT OnCancel(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  55. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  56. // message map functions
  57. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  58. LRESULT OnDestroyDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  59. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  60. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  61. // command ID handlers
  62. LRESULT OnAutoNet(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  63. LRESULT OnUseConfig(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  64. LRESULT OnIpctrl(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  65. LRESULT OnIpAddrSub(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  66. LRESULT OnIpFieldChange(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  67. private:
  68. void EnableControls();
  69. void GetIpCtrlAddress(IpControl & IpCtrl, tstring * pstr);
  70. void PageModified() { m_fModified = TRUE; PropSheet_Changed(GetParent(), m_hWnd); }
  71. void UpdateInfo();
  72. private:
  73. BOOL m_fModified;
  74. const DWORD * m_adwHelpIDs;
  75. CTcpipcfg * m_ptcpip;
  76. ADAPTER_INFO * m_pAdapterInfo;
  77. IpControl m_ipAddr;
  78. IpControl m_ipMask;
  79. IpControl m_ipDefGw;
  80. IpControl m_ipPrefferredDns;
  81. IpControl m_ipAlternateDns;
  82. IpControl m_ipPrefferredWins;
  83. IpControl m_ipAlternateWins;
  84. };