LRESULT
Type Definition
typedef LONG_PTR LRESULT;
Synopsis
The LRESULT type is used to represent the return value of a window procedure. It is defined as a signed integral type large enough to hold a pointer or a long integer.
Syntax
Header | #include <windows.h> |
---|---|
Namespace | Global (C) |
Associated Functions | DefWindowProc, SendMessage |
Remarks
- LRESULT is the type returned by a window procedure (
WndProc
). - When a message is processed, the value returned by the callback indicates success, failure, or additional message-specific information.
- On 64‑bit Windows, LRESULT is 64 bits; on 32‑bit Windows, it is 32 bits.
- Typical usage patterns:
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CREATE: return 0; case WM_PAINT: // painting code return 0; default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } }