Applies to  VB5+ 

Windows API Type Library - Notes

Here are some details about the Windows API Type Library that you might find useful.

Return to the Windows API Type Library download page

APIBOOL

The APIBOOL enumeration represents a Boolean value:

Enum APIBOOL
    APIFALSE = 0
    APITRUE = 1
End Enum

Pass APIFALSE or APITRUE to API functions that expect a BOOL argument.

FILETIME

The FILETIME 64-bit data structure is declared As Currency in the type library.

InvalidateRectPtr

InvalidateRectPtr is an alias for the InvalidateRect API function, but its second argument is passed by value and takes a Long rather than a RECT:

Declare Function InvalidateRectPtr Lib "user32" _
    Alias "InvalidateRect" (ByVal hWnd As Long, _
    ByVal lpRect As Long, ByVal bErase As APIBOOL) As APIBOOL

Declare Function InvalidateRect Lib "user32" (ByVal hWnd As Long, _
    lpRect As RECT, ByVal bErase As APIBOOL) As APIBOOL

To update the entire client area of a window, call InvalidateRectPtr instead of InvalidateRect and pass 0 as the second argument.

LARGE_INTEGER

The LARGE_INTEGER 64-bit data type is declared As Currency in the type library. LARGE_INTEGER is used by QueryPerformanceCounter and QueryPerformanceFrequency.

MoveTo

MoveTo is an alias for the MoveToEx API function, but its last argument is optional:

Declare Function MoveTo Lib "gdi32" Alias "MoveToEx" ( _
    ByVal hDC As Long, ByVal x As Long, ByVal y As Long, _
    Optional ByVal lpPoint As Long = 0) As APIBOOL

Declare Function MoveToEx Lib "gdi32" ( _
    ByVal hDC As Long, ByVal x As Long, ByVal y As Long, _
    lpPoint As POINTAPI) As APIBOOL

Use MoveTo instead of MoveToEx (and omit the last argument) if you don't need the previous drawing position.

PtInRect

The API Text Viewer supplies the following declaration for the PtInRect API function:

Declare Function PtInRect Lib "user32" (lpRect As RECT, _
    lpPoint As POINTAPI) As Long

This declaration is incorrect; lpPoint should be passed by value. Unfortunately, Visual Basic does not permit the ByVal keyword here. The type library supplies the following equivalent declaration for PtInRect:

Declare Function PtInRect Lib "user32" (lpRect As RECT, _
    ByVal x As Long, ByVal y As Long) As APIBOOL

Pass the x- and y-coordinates of the point as the second and third arguments.

SetFocusAPI

SetFocusAPI is an alias for the SetFocus API function (to avoid conflict with the SetFocus method).

TextOut

TextOut is an alias for the TextOutW API function, which supports Unicode strings. This function is available under both Windows 9x and Windows NT.

1