Windows User Interface (UI) APIs

This section provides comprehensive documentation for the Windows API functions related to creating and managing graphical user interfaces. Explore the various subsystems that enable rich and interactive applications on the Windows platform.

Controls and Standard Elements

Learn about the fundamental building blocks of Windows UIs, including buttons, text boxes, lists, and menus. Understand how to create, manipulate, and respond to user interactions with these common controls.

CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)

Creates an extended window with a class name or a registered class, window name, and specified style.

GetDlgItem(HWND hDlg, int nIDDlgItem)

Retrieves a handle to a control in a dialog box.

SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)

Sends the specified message to a window or windows.

Window Management

Discover the APIs for managing windows, including creating top-level windows, handling window messages, controlling window placement, and managing the Z-order. This is crucial for building the basic structure of any Windows application.

GetMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)

Retrieves messages from the calling thread's message queue.

TranslateMessage(const MSG *lpMsg)

Translates virtual-key messages into character messages.

DispatchMessageW(const MSG *lpMsg)

Dispatches a message to a window procedure.

SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)

Changes the size, position, and ordering of a child, pop-up, or top-level window.

Graphics and Drawing

Delve into the world of Windows graphics. This section covers the Graphics Device Interface (GDI) and GDI+ for rendering text, shapes, images, and controlling colors and pens.

CreateCompatibleDC(HDC hdc)

Creates a memory device context (DC) that is compatible with the specified device.

Rectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)

Draws a rectangle.

TextOutW(HDC hdc, int nXStart, int nYStart, LPCWSTR lpString, int cchString)

Writes a string of characters at the specified coordinates.

Input Handling

Understand how to capture and process user input from the keyboard and mouse. This includes handling mouse clicks, movements, keyboard presses, and other input events.

SetCapture(HWND hWnd)

Sets the mouse capture to a specified window.

GetKeyState(int nVirtKey)

Retrieves the status of the specified virtual-key code.

MapVirtualKeyW(UINT uCode, UINT uMapType)

Translates (maps) a virtual-key code to the corresponding character, or character code to the corresponding virtual-key code.

Further Reading