const char *GUIAPI GetClassName | ( | HWND | hWnd | ) |
Retrieves the name of the class to which the specified window belongs.
This function retrieves the name of the class to which the specified window hWnd belongs.
hWnd | The handle to the window. |
Retrieves the information of the specified window class.
This function retrives the information of a window class. The window class to be retrived is specified by pWndClass->spClassName.
pWndClass | The pointer to a WNDCLASS structure, which specifies the window class to be retrived via spClassName field, and returns the information through other fields. |
Registers a window class.
This function registers a window class. Later on, you can create a window of the registered class.
pWndClass | The pointer to a WNDCLASS structure which specifies the information of the window class. |
Example:
#define STEP_CTRL_NAME "mystep" #define MSG_SET_STEP_INFO (MSG_USER + 1) #define MSG_SET_CURR_STEP (MSG_USER + 2) static int StepControlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam) { HDC hdc; HELPWININFO* info; switch (message) { case MSG_PAINT: hdc = BeginPaint (hwnd); /* Get the step information. */ info = (HELPWININFO*)GetWindowAdditionalData (hwnd); /* Draw the step information. */ ...... EndPaint (hwnd, hdc); break; /* A message defined by the control, used to set the step information. */ case MSG_SET_STEP_INFO: SetWindowAdditionalData (hwnd, (DWORD)lParam); InvalidateRect (hwnd, NULL, TRUE); break; /* * A message defined by the control, used to set the information * of the current step. */ case MSG_SET_CURR_STEP: InvalidateRect (hwnd, NULL, FALSE); break; case MSG_DESTROY: break; } return DefaultControlProc (hwnd, message, wParam, lParam); } static BOOL RegisterStepControl () { int result; WNDCLASS StepClass; StepClass.spClassName = STEP_CTRL_NAME; StepClass.dwStyle = 0; StepClass.hCursor = GetSystemCursor (IDC_ARROW); StepClass.iBkColor = COLOR_lightwhite; StepClass.WinProc = StepControlProc; return RegisterWindowClass (&StepClass); } static void UnregisterStepControl () { UnregisterWindowClass (STEP_CTRL_NAME); }
Sets the information of the specified window class.
This function sets the information of a window class. The window class to be operated is specified by pWndClass->spClassName.
pWndClass | The pointer to a WNDCLASS structure, which specifies the new information of the window class. |
BOOL GUIAPI UnregisterWindowClass | ( | const char * | szClassName | ) |
Undoes the effect of RegisterWindowClass.
This function unregisters a registered window class specified by szClassName.
szClassName | The name of the class to be unregistered. |