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.

656 lines
19 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: S M P S H . H
  7. //
  8. // Contents: The property sheets header
  9. //
  10. // Notes:
  11. //
  12. // Author: CWill 10/14/1997
  13. //
  14. //----------------------------------------------------------------------------
  15. //
  16. // The Status Monitor's General Page
  17. //
  18. extern const WCHAR c_szNetCfgHelpFile[];
  19. const UINT PWM_UPDATE_STATUS_DISPLAY = WM_USER + 1;
  20. const UINT PWM_UPDATE_RAS_LINK_LIST = WM_USER + 2;
  21. const UINT PWM_UPDATE_IPCFG_DISPLAY = WM_USER + 3;
  22. enum StatTrans
  23. {
  24. Stat_Unknown,
  25. Stat_Bytes,
  26. Stat_Packets
  27. };
  28. //
  29. // The Status Monitors General Page
  30. //
  31. class ATL_NO_VTABLE CPspStatusMonitorGen :
  32. public CComObjectRootEx <CComObjectThreadModel>,
  33. public CPropSheetPage,
  34. public INetConnectionStatisticsNotifySink
  35. {
  36. public:
  37. CPspStatusMonitorGen(VOID);
  38. BEGIN_COM_MAP(CPspStatusMonitorGen)
  39. COM_INTERFACE_ENTRY(INetConnectionStatisticsNotifySink)
  40. END_COM_MAP()
  41. BEGIN_MSG_MAP(CPspStatusMonitorGen)
  42. // Windows Messages
  43. //
  44. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  45. MESSAGE_HANDLER(WM_CLOSE, OnClose)
  46. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  47. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  48. MESSAGE_HANDLER(WM_HELP, OnHelp);
  49. MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
  50. MESSAGE_HANDLER(WM_TIMER, OnTimer)
  51. MESSAGE_HANDLER(PWM_UPDATE_STATUS_DISPLAY, OnUpdateStatusDisplay)
  52. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  53. // Notifications
  54. //
  55. NOTIFY_CODE_HANDLER(PSN_SETACTIVE, OnSetActive)
  56. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  57. // Command handlers
  58. COMMAND_ID_HANDLER(IDC_PSB_DISCONNECT, OnDisconnect)
  59. COMMAND_ID_HANDLER(IDC_PSB_PROPERTIES, OnRaiseProperties)
  60. END_MSG_MAP()
  61. // Message handlers
  62. //
  63. public:
  64. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
  65. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  66. LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  67. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  68. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  69. LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  70. LRESULT OnSetCursor(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  71. LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  72. LRESULT OnUpdateStatusDisplay(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  73. LRESULT OnSetActive(INT idCtrl, LPNMHDR pnmh, BOOL & bHandled);
  74. LRESULT OnKillActive(INT idCtrl, LPNMHDR pnmh, BOOL & bHandled);
  75. LRESULT OnDisconnect(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  76. LRESULT OnRaiseProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  77. friend class CPspStatusMonitorRas;
  78. public:
  79. STDMETHOD(OnStatisticsChanged)(DWORD dwChangeFlags);
  80. VOID FinalRelease ();
  81. // Helper functions
  82. //
  83. public:
  84. HRESULT HrInitGenPage(CNetStatisticsEngine* pnseNew,
  85. INetConnection* pncNew,
  86. const DWORD * adwHelpIDs = NULL);
  87. HRESULT HrCleanupGenPage(VOID);
  88. HRESULT HrDisconnectConnection(BOOL fConfirmed = FALSE);
  89. VOID SetAsFirstPage(BOOL fFirst = TRUE)
  90. {
  91. m_fIsFirstPage = fFirst;
  92. }
  93. // Utility Functions
  94. //
  95. protected:
  96. VOID UpdatePage(
  97. STATMON_ENGINEDATA* pseOldData,
  98. const STATMON_ENGINEDATA* pseNewData);
  99. virtual VOID UpdatePageSpeed(
  100. const STATMON_ENGINEDATA* pseOldData,
  101. const STATMON_ENGINEDATA* pseNewData);
  102. VOID UpdatePageConnectionStatus(
  103. const STATMON_ENGINEDATA* pseOldData,
  104. const STATMON_ENGINEDATA* pseNewData);
  105. virtual VOID UpdatePageIcon(DWORD dwChangeFlags);
  106. VOID UpdateSignalStrengthIcon(INT iRSSI);
  107. virtual VOID UpdatePageDuration(
  108. const STATMON_ENGINEDATA* pseOldData,
  109. const STATMON_ENGINEDATA* pseNewData);
  110. virtual VOID UpdatePageBytesTransmitting(
  111. const STATMON_ENGINEDATA* pseOldData,
  112. const STATMON_ENGINEDATA* pseNewData,
  113. StatTrans iStat);
  114. virtual VOID UpdatePageBytesReceiving(
  115. const STATMON_ENGINEDATA* pseOldData,
  116. const STATMON_ENGINEDATA* pseNewData,
  117. StatTrans iStat);
  118. VOID UpdatePageCompTransmitting(
  119. const STATMON_ENGINEDATA* pseOldData,
  120. const STATMON_ENGINEDATA* pseNewData);
  121. VOID UpdatePageCompReceiving(
  122. const STATMON_ENGINEDATA* pseOldData,
  123. const STATMON_ENGINEDATA* pseNewData);
  124. VOID UpdatePageErrorsTransmitting(
  125. const STATMON_ENGINEDATA* pseOldData,
  126. const STATMON_ENGINEDATA* pseNewData);
  127. VOID UpdatePageErrorsReceiving(
  128. const STATMON_ENGINEDATA* pseOldData,
  129. const STATMON_ENGINEDATA* pseNewData);
  130. BOOL FIsShowLanErrorRegKeySet();
  131. virtual BOOL ShouldShowPackets(const STATMON_ENGINEDATA* pseNewData);
  132. protected:
  133. STATMON_ENGINEDATA* m_psmEngineData;
  134. CNetStatisticsEngine* m_pnseStat;
  135. DWORD m_dwChangeFlags;
  136. DWORD m_dwConPointCookie;
  137. BOOL m_fStats;
  138. NETCON_MEDIATYPE m_ncmType;
  139. NETCON_SUBMEDIATYPE m_ncsmType;
  140. DWORD m_dwCharacter;
  141. DWORD m_dwLastUpdateStatusDisplayTick;
  142. BOOL m_fProcessingTimerEvent;
  143. int m_iStatTrans;
  144. const DWORD * m_adwHelpIDs;
  145. BOOL m_fIsFirstPage;
  146. INT m_iLastSignalStrength;
  147. };
  148. //
  149. // The Status Monitors Tools Page
  150. //
  151. class CPspStatusMonitorTool: public CPropSheetPage
  152. {
  153. public:
  154. BEGIN_MSG_MAP(CPshStatusMonitorTools)
  155. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  156. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  157. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  158. MESSAGE_HANDLER(WM_HELP, OnHelp);
  159. COMMAND_ID_HANDLER(IDC_BTN_SM_TOOLS_OPEN, OnToolOpen)
  160. NOTIFY_CODE_HANDLER(LVN_ITEMACTIVATE, OnItemActivate)
  161. NOTIFY_CODE_HANDLER(LVN_ITEMCHANGED, OnItemChanged)
  162. END_MSG_MAP()
  163. // Message handlers
  164. //
  165. public:
  166. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
  167. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  168. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  169. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  170. LRESULT OnToolOpen(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  171. LRESULT OnItemActivate(INT idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  172. LRESULT OnItemChanged(INT idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  173. CPspStatusMonitorTool(VOID);
  174. ~CPspStatusMonitorTool(VOID);
  175. public:
  176. HRESULT HrInitToolPage(INetConnection* pncInit, const DWORD * adwHelpIDs = NULL);
  177. BOOL FToolListEmpty()
  178. {
  179. return (m_lstpsmte.size()==0);
  180. }
  181. private:
  182. virtual HRESULT HrInitToolPageType(INetConnection* pncInit) PURE;
  183. virtual HRESULT HrAddCommandLineFlags(tstring* pstrFlags,
  184. CStatMonToolEntry* psmteSel) PURE;
  185. virtual HRESULT HrGetDeviceType(INetConnection* pncInit) PURE;
  186. virtual HRESULT HrGetComponentList(INetConnection* pncInit) PURE;
  187. // Utility Functions
  188. //
  189. private:
  190. HRESULT HrCreateToolList(INetConnection* pncInit);
  191. BOOL FToolToAddToList(CStatMonToolEntry* psmteTest);
  192. HRESULT HrFillToolList(VOID);
  193. HRESULT HrAddOneEntryToToolList(
  194. CStatMonToolEntry* psmteAdd, INT iItem);
  195. HRESULT HrLaunchTool(VOID);
  196. HRESULT HrAddAllCommandLineFlags(tstring* pstrFlags,
  197. CStatMonToolEntry* psmteSel);
  198. HRESULT HrAddCommonCommandLineFlags(tstring* pstrFlags,
  199. CStatMonToolEntry* psmteSel);
  200. // Internal data
  201. //
  202. protected:
  203. HWND m_hwndToolList;
  204. list<CStatMonToolEntry*> m_lstpsmte;
  205. NETCON_MEDIATYPE m_ncmType;
  206. NETCON_SUBMEDIATYPE m_ncsmType;
  207. tstring m_strDeviceType;
  208. list<tstring*> m_lstpstrCompIds;
  209. GUID m_guidId;
  210. DWORD m_dwCharacter;
  211. const DWORD * m_adwHelpIDs;
  212. };
  213. //
  214. // The Status Monitors RAS Page
  215. //
  216. //
  217. // Data associated with each of the sub devices in a modem connection
  218. //
  219. class CRasDeviceInfo
  220. {
  221. public:
  222. CRasDeviceInfo()
  223. {
  224. m_iSubEntry = -1;
  225. }
  226. VOID SetDeviceName(PCWSTR pszDeviceName)
  227. {
  228. m_strDeviceName = pszDeviceName;
  229. }
  230. VOID SetSubEntry(DWORD iSubEntry)
  231. {
  232. m_iSubEntry = iSubEntry;
  233. }
  234. PCWSTR PszGetDeviceName(VOID)
  235. {
  236. return m_strDeviceName.c_str();
  237. }
  238. DWORD DwGetSubEntry(VOID)
  239. {
  240. return m_iSubEntry;
  241. }
  242. private:
  243. tstring m_strDeviceName;
  244. DWORD m_iSubEntry;
  245. };
  246. //
  247. // The RAS page
  248. //
  249. class CPspStatusMonitorRas: public CPropSheetPage
  250. {
  251. public:
  252. BEGIN_MSG_MAP(CPshStatusMonitorRas)
  253. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  254. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  255. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  256. MESSAGE_HANDLER(WM_HELP, OnHelp);
  257. MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor);
  258. COMMAND_ID_HANDLER(IDC_BTN_SM_SUSPEND_DEVICE, OnSuspendDevice)
  259. COMMAND_ID_HANDLER(IDC_CMB_SM_RAS_DEVICES, OnDeviceDropDown)
  260. MESSAGE_HANDLER(PWM_UPDATE_RAS_LINK_LIST, OnUpdateRasLinkList)
  261. END_MSG_MAP()
  262. // Message handlers
  263. //
  264. public:
  265. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
  266. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  267. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  268. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  269. LRESULT OnSetCursor(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  270. LRESULT OnSuspendDevice(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  271. LRESULT OnDeviceDropDown(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  272. LRESULT OnUpdateRasLinkList(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  273. CPspStatusMonitorRas();
  274. ~CPspStatusMonitorRas(VOID);
  275. public:
  276. HRESULT HrInitRasPage(INetConnection* pncInit,
  277. CPspStatusMonitorGen * pGenPage,
  278. const DWORD * dwHelpIDs = NULL);
  279. // Utility Functions
  280. //
  281. private:
  282. VOID FillDeviceDropDown();
  283. VOID FillPropertyList();
  284. VOID FillRasClientProperty();
  285. VOID FillRasServerProperty();
  286. int InsertProperty(int * piItem, UINT unId, tstring& strValue);
  287. NETCON_STATUS NcsGetDeviceStatus(CRasDeviceInfo* prdiStatus);
  288. VOID SetButtonStatus(CRasDeviceInfo* prdiSelect);
  289. UINT GetActiveDeviceCount();
  290. // Internal data
  291. //
  292. protected:
  293. HRASCONN m_hRasConn;
  294. tstring m_strPbkFile;
  295. tstring m_strEntryName;
  296. tstring m_strConnectionName;
  297. list<CRasDeviceInfo*> m_lstprdi;
  298. CPspStatusMonitorGen * m_pGenPage;
  299. // initialize
  300. NETCON_MEDIATYPE m_ncmType;
  301. DWORD m_dwCharacter;
  302. const DWORD * m_adwHelpIDs;
  303. };
  304. //
  305. // Implementation of the RAS pages
  306. //
  307. class CPspRasGen: public CPspStatusMonitorGen
  308. {
  309. public:
  310. CPspRasGen(VOID);
  311. VOID put_MediaType(NETCON_MEDIATYPE ncmType, NETCON_SUBMEDIATYPE ncsmType);
  312. VOID put_Character(DWORD dwCharacter);
  313. };
  314. class CPspRasTool: public CPspStatusMonitorTool
  315. {
  316. public:
  317. CPspRasTool(VOID);
  318. VOID put_MediaType(NETCON_MEDIATYPE ncmType, NETCON_SUBMEDIATYPE ncsmType);
  319. VOID put_Character(DWORD dwCharacter);
  320. HRESULT HrInitToolPageType(INetConnection* pncInit);
  321. HRESULT HrAddCommandLineFlags(tstring* pstrFlags,
  322. CStatMonToolEntry* psmteSel);
  323. HRESULT HrGetDeviceType(INetConnection* pncInit);
  324. HRESULT HrGetComponentList(INetConnection* pncInit);
  325. };
  326. //
  327. // Implementation of the LAN pages
  328. //
  329. class CPspLanGen: public CPspStatusMonitorGen
  330. {
  331. public:
  332. CPspLanGen(VOID);
  333. VOID put_MediaType(NETCON_MEDIATYPE ncmType, NETCON_SUBMEDIATYPE ncsmType);
  334. };
  335. class CPspLanTool: public CPspStatusMonitorTool
  336. {
  337. public:
  338. CPspLanTool(VOID);
  339. HRESULT HrInitToolPageType(INetConnection* pncInit);
  340. HRESULT HrAddCommandLineFlags(tstring* pstrFlags,
  341. CStatMonToolEntry* psmteSel);
  342. HRESULT HrGetDeviceType(INetConnection* pncInit);
  343. HRESULT HrGetComponentList(INetConnection* pncInit);
  344. private:
  345. tstring m_strDeviceName;
  346. };
  347. //
  348. // Implementation of the Shared Access pages
  349. //
  350. class CPspSharedAccessGen: public CPspStatusMonitorGen
  351. {
  352. public:
  353. CPspSharedAccessGen(VOID);
  354. VOID put_MediaType(NETCON_MEDIATYPE ncmType, NETCON_SUBMEDIATYPE ncsmType);
  355. protected:
  356. VOID UpdatePageBytesReceiving(const STATMON_ENGINEDATA* pseOldData, const STATMON_ENGINEDATA* pseNewData, StatTrans iStat);
  357. VOID UpdatePageBytesTransmitting(const STATMON_ENGINEDATA* pseOldData, const STATMON_ENGINEDATA* pseNewData, StatTrans iStat);
  358. BOOL ShouldShowPackets(const STATMON_ENGINEDATA* pseNewData);
  359. VOID UpdatePageIcon(DWORD dwChangeFlags);
  360. VOID UpdatePageSpeed(const STATMON_ENGINEDATA* pseOldData, const STATMON_ENGINEDATA* pseNewData);
  361. VOID UpdatePageDuration(const STATMON_ENGINEDATA* pseOldData, const STATMON_ENGINEDATA* pseNewData);
  362. };
  363. class CPspSharedAccessTool : public CPspStatusMonitorTool
  364. {
  365. public:
  366. CPspSharedAccessTool();
  367. HRESULT HrInitToolPageType(INetConnection* pncInit);
  368. HRESULT HrAddCommandLineFlags(tstring* pstrFlags,
  369. CStatMonToolEntry* psmteSel);
  370. HRESULT HrGetDeviceType(INetConnection* pncInit);
  371. HRESULT HrGetComponentList(INetConnection* pncInit);
  372. };
  373. class CAdvIpcfgDlg : public CDialogImpl<CAdvIpcfgDlg>
  374. {
  375. public:
  376. enum { IDD = IDD_DIALOG_ADV_IPCFG };
  377. BEGIN_MSG_MAP(CAdvIpcfgDlg)
  378. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog);
  379. MESSAGE_HANDLER(WM_CLOSE, OnClose);
  380. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  381. MESSAGE_HANDLER(WM_HELP, OnHelp);
  382. MESSAGE_HANDLER(PWM_UPDATE_IPCFG_DISPLAY, OnUpdateDisplay)
  383. COMMAND_ID_HANDLER(IDOK, OnOk);
  384. COMMAND_ID_HANDLER(IDCANCEL, OnCancel);
  385. NOTIFY_CODE_HANDLER(LVN_KEYDOWN, OnListKeyDown);
  386. END_MSG_MAP()
  387. //
  388. public:
  389. CAdvIpcfgDlg();
  390. ~CAdvIpcfgDlg() {}
  391. VOID InitDialog(const GUID & guidConnection, const DWORD * dwHelpIDs = NULL)
  392. {
  393. m_guidConnection = guidConnection;
  394. m_adwHelpIDs = dwHelpIDs;
  395. }
  396. // Dialog creation overides
  397. public:
  398. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  399. LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  400. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  401. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  402. LRESULT OnUpdateDisplay(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  403. LRESULT OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  404. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  405. LRESULT OnListKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  406. private:
  407. HRESULT PopulateListControl();
  408. VOID AddToListControl(int iIndex, LPWSTR szFirst, LPWSTR szSecond);
  409. int AddIPAddrToListControl(int iStartIndex,
  410. PIP_ADDR_STRING pAddrList,
  411. LPWSTR pszAddrDescription,
  412. LPWSTR pszMaskDescription = NULL,
  413. BOOL fShowDescriptionForMutliple = FALSE
  414. );
  415. int AddWinsServersToList(int iStartIndex);
  416. VOID CopyListToClipboard();
  417. int IPAddrToString(
  418. PIP_ADDR_STRING pAddrList,
  419. tstring * pstrAddr,
  420. tstring * pstrMask = NULL
  421. );
  422. HRESULT FormatTime(time_t t,
  423. tstring & str);
  424. protected:
  425. GUID m_guidConnection;
  426. HWND m_hList;
  427. const DWORD * m_adwHelpIDs;
  428. };
  429. //
  430. // The State page
  431. //
  432. class CPspStatusMonitorIpcfg: public CPropSheetPage
  433. {
  434. protected:
  435. public:
  436. BEGIN_MSG_MAP(CPspStatusMonitorIpcfg)
  437. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  438. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  439. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  440. MESSAGE_HANDLER(WM_HELP, OnHelp);
  441. MESSAGE_HANDLER(PWM_UPDATE_IPCFG_DISPLAY, OnUpdateDisplay)
  442. COMMAND_ID_HANDLER(IDC_STATE_BTN_REPAIR, OnRepair);
  443. COMMAND_ID_HANDLER(IDC_STATE_BTN_DETAIL, OnDetails);
  444. NOTIFY_CODE_HANDLER(PSN_SETACTIVE, OnActive)
  445. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  446. END_MSG_MAP()
  447. // Message handlers
  448. //
  449. public:
  450. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
  451. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  452. LRESULT OnRepair(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  453. LRESULT OnDetails(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& fHandled);
  454. LRESULT OnActive(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  455. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  456. LRESULT OnUpdateDisplay(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  457. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  458. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  459. CPspStatusMonitorIpcfg();
  460. ~CPspStatusMonitorIpcfg();
  461. public:
  462. HRESULT HrInitPage(INetConnection * pnConnection,
  463. const DWORD * adwHelpIDs = NULL);
  464. VOID CleanupPage();
  465. VOID SetAsFirstPage(BOOL fFirst = TRUE)
  466. {
  467. m_fIsFirstPage = fFirst;
  468. }
  469. static DWORD WINAPI IPAddrListenProc(LPVOID lpParameter);
  470. static DWORD WINAPI AdvIpCfgProc(LPVOID lpParameter);
  471. // Utility Functions
  472. //
  473. private:
  474. HRESULT GetIPConfigInfo();
  475. VOID InitializeData();
  476. VOID RefreshUI();
  477. VOID StopAddressListenThread();
  478. // Internal data
  479. //
  480. protected:
  481. CAdvIpcfgDlg m_dlgAdvanced;
  482. GUID m_guidConnection;
  483. tstring m_strConnectionName;
  484. tstring m_strIPAddress;
  485. tstring m_strSubnetMask;
  486. tstring m_strGateway;
  487. HANDLE m_hEventAddrListenThreadStopCommand;
  488. HANDLE m_hEventAddrListenThreadStopNotify;
  489. DHCP_ADDRESS_TYPE m_dhcpAddrType;
  490. BOOL m_fDhcp;
  491. // initialize
  492. NETCON_MEDIATYPE m_ncmType;
  493. const DWORD * m_adwHelpIDs;
  494. INetConnection * m_pConn;
  495. BOOL m_fListenAddrChange;
  496. BOOL m_fEnableOpButtons;
  497. BOOL m_fIsFirstPage;
  498. };