What is the HWND parameter in the Windows Procedure Functions? [duplicate]

StackOverflow https://stackoverflow.com/questions/20411986

  •  29-08-2022
  •  | 
  •  

Pregunta

I was testing some Win32 apps with c++, and in this code:

LRESULT CALLBACK WindowProc(

_In_ HWND hwnd,

_In_ UINT uMsg,

_In_ WPARAM wParam,

_In_ LPARAM lParam

);

Looking at this MSDN Documentation, I couldn't really understand what the HWND is?

It says: A handle to the window.. What does that mean?

¿Fue útil?

Solución

The answer is there behind the "Conceptual" section link on the MSDN page you refer to.

About Windows - Window Handle:

Window Handle

After creating a window, the creation function returns a window handle that uniquely identifies the window. A window handle has the HWND data type; an application must use this type when declaring a variable that holds a window handle. An application uses this handle in other functions to direct their actions to the window.

About Window Procedures

Structure of a Window Procedure

A window procedure is a function that has four parameters and returns a signed value. The parameters consist of a window handle, a UINT message identifier, and two message parameters declared with the WPARAM and LPARAM data types. For more information, see WindowProc.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top