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.

65 lines
1.8 KiB

  1. #pragma once
  2. #include "resource.h"
  3. #include "wlbsparm.h"
  4. #define WLBS_IP_FIELD_ZERO_LOW 1
  5. #define WLBS_IP_FIELD_ZERO_HIGH 223
  6. //+----------------------------------------------------------------------------
  7. //
  8. // class CIpSubnetMaskControl
  9. //
  10. // Description: Add error checking for an IP address and subnet mask pair.
  11. // Generate default subnetmask based on ip
  12. //
  13. // History: shouse initial code
  14. // fengsun Created class 1/12/01
  15. //
  16. //+----------------------------------------------------------------------------
  17. class CIpSubnetMaskControl
  18. {
  19. public:
  20. CIpSubnetMaskControl(DWORD dwIpAddressResourceId, DWORD dwSubnetMaskResourceId);
  21. ~CIpSubnetMaskControl(){};
  22. void OnInitDialog(HWND hWnd, HINSTANCE hInstance);
  23. LRESULT OnSubnetMask(WORD wNotifyCode);
  24. LRESULT OnIpFieldChange(int idCtrl, LPNMHDR pnmh);
  25. void SetInfo(const WCHAR* pszIpAddress, const WCHAR* pszSubnetMask);
  26. void UpdateInfo(OUT WCHAR* pszIpAddress, OUT WCHAR* pszSubnetMask);
  27. bool ValidateInfo();
  28. protected:
  29. DWORD m_dwIpAddressId;
  30. DWORD m_dwSubnetMaskId;
  31. HWND m_hWndDialog; // parent dialog window handle
  32. HINSTANCE m_hInstance; // instance handle for error string resource
  33. //
  34. // The PropertySheet may call us twice for the same change, so we have to do the bookkeeping to make
  35. // sure we only alert the user once. Use static variables to keep track of our state. This will
  36. // allow us to ignore duplicate alerts.
  37. //
  38. struct {
  39. UINT IpControl;
  40. int Field;
  41. int Value;
  42. UINT RejectTimes;
  43. } m_IPFieldChangeState;
  44. };
  45. INT
  46. WINAPIV
  47. NcMsgBox (
  48. IN HINSTANCE hinst,
  49. IN HWND hwnd,
  50. IN UINT unIdCaption,
  51. IN UINT unIdFormat,
  52. IN UINT unStyle,
  53. IN ...);