IP Address – Giavapps Windows API

 

 

api_ipaddress_create(ParentHandle, X, Y, W, H, Flags, ExFlags) This function creates an IP address control.

ParentHandle: parent handle.
X: x coordinate.
Y: y coordinate.
W: width.
H: height.
Flags: Flags of the control. Flags must be separated with the symbol "|".
ExFlags: extended flags of the control. Flags must be separated with the symbol "|".

 

Flags

 

This control supports the Window Styles.

 

Extended Flags

 

This control supports the Extended Window Styles.

 

Return Value

 

If the function succeeds, the return value is a handle to the new IP address control.

If the function fails, the return value is false.

To get extended error information, call api_control_get_last_error().

 

Control Functions

 

api_ipaddress_set_address(IPAddressHandle, Field0, Field1, Field2, Field3) Sets the address values for all four fields in the IP address control.

IPAddressHandle: it must be an IPAddressHandle.
Field0: identifies the first field. This argument can be a real value from 0 to 255 (one byte).
Field1: identifies the second field. This argument can be a real value from 0 to 255 (one byte).
Field2: identifies the third field. This argument can be a real value from 0 to 255 (one byte).
Field3: identifies the fourth field. This argument can be a real value from 0 to 255 (one byte).

 

api_ipaddress_get_address(IPAddressHandle, FieldIndex) Returns the address values for one of four fields in the IP address control or -1 if you input an invalid field index.

IPAddressHandle: it must be an IPAddressHandle.
FieldIndex: the zero-based index of the field to retrieve.

 

api_ipaddress_set_focus(IPAddressHandle, FieldIndex) Sets the keyboard focus to the specified field in the IP address control. All of the text in that field will be selected.

IPAddressHandle: it must be an IPAddressHandle.
FieldIndex: zero-based field index to which the focus should be set. If this value is greater than the number of fields, focus is set to the first blank field. If all fields are nonblank, focus is set to the first field.

 

api_ipaddress_set_range(IPAddressHandle, FieldIndex, Minimum, Maximum) Sets the valid range for the specified field in the IP address control.

IPAddressHandle: it must be an IPAddressHandle.
FieldIndex: the zero-based index of the field.
Minimum: the minimum limit of the range.
Maximum: the maximum limit of the range.

 

api_ipaddress_get_blank(IPAddressHandle) Returns true if all fields in the IP address control are blank or false otherwise.

IPAddressHandle: it must be an IPAddressHandle.

 

api_ipaddress_reset(IPAddressHandle) Clears the contents of the IP address control.

IPAddressHandle: it must be an IPAddressHandle.

 

Code Examples

 

Creating an IP Address Control

 

ipaddress = api_ipaddress_create(window,20,20,160,21,WS_VISIBLE | WS_CHILD,0);

 

Checking if an IP Address Control is Blank

 

if(api_ipaddress_get_blank(ipaddress))
{
api_ipaddress_set_address(ipaddress,0,0,0,0);
}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*