cSetIpAddr

This function places an IP address stored in an IP Address common control.

The class name for this control is "SysIPAddress32".

Syntax:

cSetIpAddr(window-handle, IP address)

Parameters:

(i) window-handle Window handle to an IP Address Controls.

(s) IP Address Text string containing Internet protocol (IP) address.

Returns:

(i)  @TRUE, if address has been placed in control @FALSE, if address could not be set.

 

Note: Several Windows system property sheets contain controls that look and behave like an IP address control. However, these controls are not a common control and have different class names. This function does make an attempt to identify and set an IP address for these pseudo common controls.

 

Example:

AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
; Find Control Spy ip address window handle.
hwnd = DllHwnd("Microsoft Control Spy -")
hwnd = cWndbyclass(hwnd, "CSPYContainer")
hwnd = cWndbyclass(hwnd,"SysIPAddress32")
; Get the address.
If cSetIpAddr(hwnd,"254.254.254.254")
   ; Test ip address get function
   ipaddr = cGetIpAddr(hwnd)
   ; Get the window class name and display the new IP address.
   wintext = cWndinfo(hwnd, "2")
   If wintext == ""
      wintext = "a Classless Window"
   EndIf
   Message("IP Address from %wintext%.", "IP Address: %ipaddr%.")
EndIf
Exit

See Also:

cGetIpAddr, cWndByClass, cWndInfo, DLLhwnd (WIL help).