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.

58 lines
1.6 KiB

  1. /* Copyright (c) 1991, Microsoft Corporation, all rights reserved
  2. ipaddr.h - TCP/IP Address custom control, global definitions
  3. November 10, 1992 - Greg Strange
  4. */
  5. #ifndef _IPADDR_H_
  6. #define _IPADDR_H_
  7. // Messages sent to IPAddress controls
  8. #define IP_CLEARADDRESS WM_USER+100 // no parameters
  9. #define IP_SETADDRESS WM_USER+101 // lparam = TCP/IP address
  10. #define IP_GETADDRESS WM_USER+102 // lresult = TCP/IP address
  11. #define IP_SETRANGE WM_USER+103 // wparam = field, lparam = range
  12. #define IP_SETFOCUS WM_USER+104 // wparam = field
  13. #define IP_ISBLANK WM_USER+105 // no parameters
  14. // The following is a useful macro for passing the range values in the
  15. // IP_SETRANGE message.
  16. #define MAKERANGE(low,high) ((LPARAM)(WORD)(((BYTE)(high)<<8)+(BYTE)(low)))
  17. // And this is a useful macro for making the IP Address to be passed
  18. // as a LPARAM.
  19. #define MAKEIPADDRESS(b1,b2,b3,b4) ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
  20. // Get individual number
  21. #define FIRST_IPADDRESS(x) ((x>>24) & 0xff)
  22. #define SECOND_IPADDRESS(x) ((x>>16) & 0xff)
  23. #define THIRD_IPADDRESS(x) ((x>>8) & 0xff)
  24. #define FOURTH_IPADDRESS(x) (x & 0xff)
  25. // Use this function to force the ip address entered to
  26. // be contiguous (series of 1's followed by a series of 0's).
  27. // This is useful for entering valid submasks
  28. //
  29. // Returns NO_ERROR if successful, error code otherwise
  30. //
  31. DWORD APIENTRY
  32. IpAddr_ForceContiguous(
  33. HWND hwndIpAddr );
  34. // Call this function once during initialization.
  35. int FAR PASCAL
  36. IpAddrInit(
  37. IN HANDLE hInstance,
  38. IN DWORD dwErrorTitle,
  39. IN DWORD dwBadIpAddrRange );
  40. #endif // _IPADDR_H_