Register a window class

I think my question is relatively simple for those of you who have spent time working with the Win32 API.

So my question is:
After initializing the WNDCLASSEX instance, we need to "register" it using the "RegisterClassEx" function, why? Why are we doing this? What is the point of this registration and in what cases do I need to register things?

+2
source share
2 answers

ATOM, returned RegisterClassEx, uniquely identifies your "window class", which can then be specified in other Windows APIs. [ MSDN ]

, , . , .

. Hans Passant answer , OO, C. MSDN.

+5

Class . - , ++, Delphi, Java # .., . winapi C, . RegisterClassEx() , , "" , , . , , , .

WNDCLASSEX, , . :

  • lpszClassName. ++. CreateWindowEx() , , . Windows RegisterClassEx(), , . "EDIT", "BUTTON" "LISTBOX" .
  • lpfnWndProc. , . , . , "" , CreateWindowEx(). DefWindowProc(), . , , .
  • hIcon .. , , . . , WM_ERASEBKGND, hbrBackground .

Windows , RegisterClassEx(), . , , . , , , , . "EDIT".

+4

All Articles