Win32 API Structures
Structures are data types used to group related data items together. They are fundamental building blocks for many Windows API functions and operations.
General Structures
RECT
Defines the coordinates of the upper-left and lower-right corners of a rectangle.
typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
\} RECT;
Members:
left: The x-coordinate of the upper-left corner.top: The y-coordinate of the upper-left corner.right: The x-coordinate of the lower-right corner.bottom: The y-coordinate of the lower-right corner.
POINT
Specifies a point in two-dimensional space.
typedef struct _POINT {
LONG x;
LONG y;
\} POINT;
Members:
x: The x-coordinate of the point.y: The y-coordinate of the point.
Memory Management Structures
MEMORYSTATUSEX
Contains information about the current memory utilization of the local computer. This structure is an extension of the MEMORYSTATUS structure.
typedef struct _MEMORYSTATUSEX {
DWORD dwLength;
DWORD dwMemoryLoad;
SIZE_T ullTotalPhys;
SIZE_T ullAvailPhys;
SIZE_T ullTotalPageFile;
SIZE_T ullAvailPageFile;
SIZE_T ullTotalVirtual;
SIZE_T ullAvailVirtual;
SIZE_T ullAvailExtendedVirtual;
\} MEMORYSTATUSEX;
Members:
dwLength: The size of the structure, in bytes.dwMemoryLoad: A number between 0 and 100 (inclusive) indicating the approximate percentage of physical memory currently in use.ullTotalPhys: The total size of physical memory, in bytes.ullAvailPhys: The available physical memory, in bytes.ullTotalPageFile: The total size of the memory-backed page file, in bytes.ullAvailPageFile: The available size of the memory-backed page file, in bytes.ullTotalVirtual: The total size of the user-mode virtual memory, in bytes.ullAvailVirtual: The available user-mode virtual memory, in bytes.ullAvailExtendedVirtual: The extended available virtual memory, in bytes.
Processes and Threads Structures
PROCESS_INFORMATION
Contains information about a newly created process and its primary thread.
typedef struct _PROCESS_INFORMATION {
HANDLE hProcess;
HANDLE hThread;
DWORD dwProcessId;
DWORD dwThreadId;
\} PROCESS_INFORMATION;
Members:
hProcess: A handle to the new process.hThread: A handle to the primary thread of the new process.dwProcessId: A non-zero, unique value representing the process ID.dwThreadId: A non-zero, unique value representing the thread ID.
Window Management Structures
WINDOWINFO
Contains information about a window.
typedef struct tagWINDOWINFO {
DWORD cbSize;
RECT rcWindow;
RECT rcClient;
DWORD dwStyle;
DWORD dwExStyle;
DWORD dwWindowStatus;
UINT cxWindowBorders;
UINT cyWindowBorders;
ATOM atomWindowType;
WORD wCreatorVersion;
\} WINDOWINFO;
Members:
cbSize: The size of the structure, in bytes.rcWindow: The coordinates of the window.rcClient: The coordinates of the window's client area.dwStyle: The window styles.dwExStyle: The extended window styles.dwWindowStatus: The window status.cxWindowBorders: The width of the window borders.cyWindowBorders: The height of the window borders.atomWindowType: The window class atom.wCreatorVersion: The version of the application that created the window.
This is a partial list of commonly used Win32 API structures. For a comprehensive list, please refer to the official Microsoft documentation.