MSDN Documentation

Win32 API Structures

This section details the structures used within the Win32 API. Structures are composite data types that group related data items, often of different types, into a single unit. They are fundamental for passing complex information to and from Win32 functions.

RECT

The RECT structure defines a rectangle by the coordinates of its upper-left and lower-right corners.

typedef struct _RECT {
    LONG left;
    LONG top;
    LONG right;
    LONG bottom;
} RECT;

See also: POINT, SIZE.

POINT

The POINT structure defines a point in two-dimensional space (x-coordinate and y-coordinate).

typedef struct _POINT {
    LONG x;
    LONG y;
} POINT;

See also: RECT, SIZE.

SIZE

The SIZE structure specifies a Win32 application's size, in pixels, of a rectangle or a position, in the order cx (width) and cy (height).

typedef struct _SIZE {
    LONG cx;
    LONG cy;
} SIZE;

See also: POINT, RECT.

MSG

The MSG structure contains message information available from the application message queue.

typedef struct _MSG {
    HWND hwnd;
    UINT message;
    WPARAM wParam;
    LPARAM lParam;
    DWORD time;
    POINT pt;
} MSG;

See also: WNDCLASS.

WNDCLASS

The WNDCLASS structure defines the window class characteristics that are registered by the RegisterClass function.

typedef struct _WNDCLASS {
    UINT style;
    WNDPROC lpfnWndProc;
    int cbClsExtra;
    int cbWndExtra;
    HINSTANCE hInstance;
    HICON hIcon;
    HCURSOR hCursor;
    HBRUSH hbrBackground;
    LPCTSTR lpszMenuName;
    LPCTSTR lpszClassName;
} WNDCLASS, *LPWNDCLASS;

See also: MSG, RegisterClass.

CREATESTRUCT

The CREATESTRUCT structure contains information about the window being created as a result of a CreateWindow or CreateWindowEx function call.

typedef struct _CREATESTRUCT {
        LPVOID lpCreateParams;
        HINSTANCE hInstance;
        HMENU hMenu;
        HWND hwndParent;
        int cx;
        int cy;
        int x;
        int y;
        LONG style;
        LPCTSTR lpszName;
        LPCTSTR lpszClass;
        DWORD dwExStyle;
} CREATESTRUCT, *LPCREATESTRUCT;

BITMAP

The BITMAP structure specifies the bitmap characteristics. It is used by the GetObject function.

typedef struct tagBITMAP {
    LONG bmType;
    LONG bmWidth;
    LONG bmHeight;
    LONG bmWidthBytes;
    WORD bmPlanes;
    WORD bmBitsPixel;
    LPVOID bmBits;
} BITMAP, *PBITMAP, NEAR *NBMPTR, FAR *LPBITMAP;

LOGFONT

The LOGFONT structure contains the characteristics of a logical font—that is, the specification for a font that can be used to create a font with the graphics programming interface (GDI).

typedef struct tagLOGFONT {
    LONG lfHeight;
    LONG lfWidth;
    LONG lfEscapement;
    LONG lfOrientation;
    LONG lfWeight;
    BYTE lfItalic;
    BYTE lfUnderline;
    BYTE lfStrikeOut;
    BYTE lfCharSet;
    BYTE lfOutPrecision;
    BYTE lfClipPrecision;
    BYTE lfQuality;
    BYTE lfPitchAndFamily;
    TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT;

This structure has many members controlling font properties such as height, width, escapement, orientation, weight, italic, underline, strikeout, character set, precision, quality, and face name.

SECURITY_ATTRIBUTES

The SECURITY_ATTRIBUTES structure contains security descriptor information that is used when creating certain securable objects.

typedef struct _SECURITY_ATTRIBUTES {
    DWORD nLength;
    LPVOID lpSecurityDescriptor;
    BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;

FILETIME

The FILETIME structure is a 64-bit value that represents the number of 100-nanosecond intervals since January 1, 1601 (UTC).

typedef struct _FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME, *PFILETIME, *LPFILETIME;

For a comprehensive list of Win32 API structures, please refer to the main index or use the search functionality.