Objects/Controls like labels and buttons are simply a special type of window, with associated window class and window procedure. As such, you call CreateWindowEx and supply for the second parameter, lpClassName, the class name of object/control you want to create (eg. for a label use the class name STATIC
).
Check out the following tutorial for a complete example, using the BUTTON class
To create a button:
HWND hWndButton=CreateWindowEx(NULL,
"BUTTON",
"OK",
WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_DEFPUSHBUTTON,
50,
220,
100,
24,
hWnd,
(HMENU)IDC_MAIN_BUTTON,
GetModuleHandle(NULL),
NULL);`