[Win32 API] WNDCLASSEX Structure

Contain window class information. It is used with the RegisterClassEx and GetClassInfoEx functions.

The WNDCLASSEX structure is similar to the WNDCLASS structure. There are two differences. WNDCASSEX include the cbSize member, which specifies the size of the structure, and the hIconSm member, which contains a handle to a small icon associated withe the window class.

Syntax

typedef struct tagWNDCLASSEX {
  UINT      cbSize;
  UINT      style;
  WNDPROC   lpfnWndProc;
  int       cbClsExtra;
  int       cbWndExtra;
  HINSTANCE hInstance;
  HICON     hIcon;
  HCURSOR   hCursor;
  HBRUSH    hbrBackground;
  LPCTSTR   lpszMenuName;
  LPCTSTR   lpszClassName;
  HICON     hIconSm;
} WNDCLASSEX, *PWNDCLASSEX;

Members

  • cbSize : The size, in bytes, of this structure. Set this member to sizeof(WNDCLASSEX). Be sure to set this member before calling GetClassinfoEx function.
  • style : The class style(s). This member can be any combination of the Class Style.
  • lpfnWndProc : A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. 
  • cbClsExtra : The number of extra bytes to allocate following the window structure. The system initializes the bytes to zero.
  • cbWndExtra : The number of extra bytes to allocate following the window instance. The system initializes the bytes to zero.If an application uses WNDCLASSEX to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA.
  • hInstance : A handle to the instance that contains the window procedure for the class.
  • hIcon : A handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon.
  • hCursor: A handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, the application must explicitly set the cursor shape whenever the mouse moves into the application's window.
  • hbrBackground : A handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value.
  • lpszMenuName : Pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appear in the resource file. If you use an integer to indetify the menu, use the MAKEINTERSOURCE macro. If this member is NULL, windows belonging to this class have no default menu.
  • lpszClassName : A Pointer to a null-terminated or is an atom. If this parameter is an atom, it must be a class atom created by previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpszClassName; the high-order word must be zero.
  • hIconSm : A handle to a small icon that associated with the window class.

댓글

이 블로그의 인기 게시물

[Win32 API] WINAPI - 함수호출규약

JAVA Frame Icon setting

JAVA Spinner