Thanks Niara, that helped me understand it a lot more, but I still can't get it to work.
Code:
switch (message){
case WM_PAINT:
hDC = BeginPaint(hwnd,&paintstruct);
TextOut(hDC,0,0,string,sizeof(string));
CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
150, 150, 50, 50, hwnd, (HMENU)IDC_MAIN_EDIT, g_hInst, NULL);
EndPaint(hwnd,&paintstruct);
break;
case WM_COMMAND:
switch(LOWORD(wParam)){
case IDC_MAIN_EDIT:
MessageBox(NULL,"Button pressed!!","HEY",NULL);
}
break;
break;
}
Am I suppose to create the button inside WM_COMMAND or WM_PAINT? The button doesn't even show up when I try it in either.