Maybe you should read before posting it clearly says i used createwindow() from inside the windows proc but if you want it any way here:
Code:
void Createwins()
{
hButtona = CreateWindowEx (0,"BUTTON",
"",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | BS_BITMAP,
35,
38,
40,
40,
hwnd,
(HMENU)IDB_BUTTON1,
((LPCREATESTRUCT) lParam)->hInstance,
NULL);
/* Set the button image */
SendMessage(hButtona,
BM_SETIMAGE,
IMAGE_BITMAP,
(LPARAM)LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_ONE)));
(and 15 more similar buttons)
(this is inside windowsproc)
if (LOWORD(wParam) == IDB_BUTTON17 &&
HIWORD(wParam) == BN_CLICKED &&
(HWND) lParam == hButtonx)
{
createwins();
}