You set the button to have the static control as its parent...therefore all messages created by the button will go to the static (which is a window in its own right, albeit with a very simple WndProc that is implemented by the system). If you make the following change to youe WM_CREATE handler it will work
Code:
case WM_CREATE:
Label1 = CreateWindowEx(WS_EX_CONTROLPARENT, "static",
"Label1", WS_VISIBLE|WS_CHILD,
12, 17, 361, 165, hWnd,
(HMENU) ID_Label1, hInst, NULL);
SendMessage(Label1, (UINT) WM_SETFONT,
(WPARAM) GetStockObject(DEFAULT_GUI_FONT),
(LPARAM) MAKELPARAM(FALSE, 0));
Button1 = CreateWindowEx(0, "Button", "Button1",
WS_VISIBLE|WS_CHILD|BS_PUSHLIKE|WS_TABSTOP,
33, 113, 86, 27, hWnd,
(HMENU) ID_Button1, hInst, NULL);
SendMessage(Button1, (UINT) WM_SETFONT,
(WPARAM) GetStockObject(DEFAULT_GUI_FONT),
(LPARAM) MAKELPARAM(FALSE, 0));
break;