-
STATIC class
What library should I include for this, because windows.h, stdlib.h, and commctrl.h aren't cutting it. Thanks in advance.
Code:
HWND CreateLabel(char caption[], char classname[], int x, int y, int height, int width)
{
HWND hwndButton;
hwndButton = CreateWindow(
STATIC, // predefined class
caption, // button text
WS_VISIBLE | WS_CHILD | SS_SIMPLE, // styles
x, // starting x position
y, // starting y position
height, // button width
width, // button height
hwnd, // parent window
NULL, // No menu
(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
NULL); // pointer not needed
return hwndButton;
}
-
It's a string, so it needs to be in quotes.
-
Classnames are just strings. Some have macro for them, include in commctrl.h.