WindowProc

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

  • DeutschWindowProc
  • EnglishWindowProc

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In Win32 application programming, WindowProc (or window procedure), also known as WndProc, is a user-defined callback function that processes messages sent to a window. This function is specified when an application registers its window class and can be named anything (not necessarily WindowProc).

In Win32 application programming, WindowProc (or window procedure), also known as WndProc, is a user-defined callback function that processes messages sent to a window. This function is specified when an application registers its window class and can be named anything (not necessarily WindowProc). ==Message handling== The window procedure is responsible for handling all messages that are sent to a window. The function prototype of WindowProc is given by: LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) hwnd is a handle to the window to which the message was sent and uMsg identifies the actual message by its identifier, as specified in winuser.h. wParam and lParam are parameters whose meaning depends on the message. An application should identify the message and take the required action. ==Default processing== Hundreds of different messages are produced as a result of various events taking place in the system, and typically, an application processes only a small fraction of these messages. In order to ensure that all messages are processed, Windows provides a default window procedure called DefWindowProc that provides default processing for messages that the application itself does not process. An application usually calls DefWindowProc at the end of its own WindowProc function, so that unprocessed messages can be passed down to the default procedure. ==See also== Event loop Desktop Window Manager ==External links== "Writing the Window Procedure" at Microsoft Learn DefWindowProc at Microsoft Learn

Text derived from https://en.wikipedia.org/w/index.php?oldid=1371250208 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot enwiki-001371250208 · captured 1787654649.0 · version history

Cite this page as: encyclopegia.org, “WindowProc”, snapshot enwiki-001371250208. https://encyclopegia.org/a/windowproc