ReactOS  0.4.15-dev-489-g75a0787
WindowClass Struct Reference

#include <window.h>

Inheritance diagram for WindowClass:
Collaboration diagram for WindowClass:

Public Member Functions

 WindowClass (LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)
 
ATOM Register ()
 
 operator ATOM ()
 
 operator LPCTSTR ()
 

Protected Attributes

ATOM _atomClass
 

Additional Inherited Members

- Public Attributes inherited from _WNDCLASSEXA
UINT cbSize
 
UINT style
 
WNDPROC lpfnWndProc
 
int cbClsExtra
 
int cbWndExtra
 
HINSTANCE hInstance
 
HICON hIcon
 
HCURSOR hCursor
 
HBRUSH hbrBackground
 
LPCSTR lpszMenuName
 
LPCSTR lpszClassName
 
HICON hIconSm
 

Detailed Description

WindowClass is a neat wrapper for RegisterClassEx(). Just construct a WindowClass object, override the attributes you want to change, then call Register() or simply request the ATOM value to register the window class. You don't have to worry calling Register() more than once. It checks if, the class has already been registered.

Definition at line 226 of file window.h.

Constructor & Destructor Documentation

◆ WindowClass()

WindowClass::WindowClass ( LPCTSTR  classname,
UINT  style = 0,
WNDPROC  wndproc = Window::WindowWndProc 
)

Definition at line 31 of file window.cpp.

32 {
33  memset(this, 0, sizeof(WNDCLASSEX));
34 
35  cbSize = sizeof(WNDCLASSEX);
36  style = style_;
39  this->hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
41  lpfnWndProc = wndproc;
42 
43  _atomClass = 0;
44 }
UINT style
Definition: winuser.h:3177
HCURSOR hCursor
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3178
LPCSTR lpszClassName
Definition: winuser.h:3186
WCHAR classname[128]
Definition: startup.c:15
HINSTANCE hInstance
Definition: winuser.h:3181
UINT cbSize
Definition: winuser.h:3176
HBRUSH hbrBackground
Definition: winuser.h:3184
ATOM _atomClass
Definition: window.h:244
HINSTANCE _hInstance
Definition: globals.h:270
#define COLOR_BTNFACE
Definition: winuser.h:918
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define LoadCursor
Definition: winuser.h:5787
#define IDC_ARROW
Definition: winuser.h:682
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define memset(x, y, z)
Definition: compat.h:39

Member Function Documentation

◆ operator ATOM()

Definition at line 238 of file window.h.

238 {return Register();}
ATOM Register()
Definition: window.h:230

◆ operator LPCTSTR()

Definition at line 241 of file window.h.

241 {return (LPCTSTR)(int)Register();}
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
ATOM Register()
Definition: window.h:230
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

◆ Register()

ATOM WindowClass::Register ( void  )
inline

Definition at line 230 of file window.h.

231  {
232  if (!_atomClass)
233  _atomClass = RegisterClassEx(this);
234 
235  return _atomClass;
236  }
#define RegisterClassEx
Definition: winuser.h:5812
ATOM _atomClass
Definition: window.h:244

Referenced by InitInstance(), operator ATOM(), and operator LPCTSTR().

Member Data Documentation

◆ _atomClass

ATOM WindowClass::_atomClass
protected

Definition at line 244 of file window.h.

Referenced by Register(), and WindowClass().


The documentation for this struct was generated from the following files: