To make your application process mouse-button input messages, add WM_LBUTTONUP and WM_LBUTTONDOWN cases to the window procedure, as follows:
case WM_LBUTTONDOWN:
wsprintf(ButtonText, "WM_LBUTTONDOWN: %x, %d, %d",
wParam, LOWORD(lParam), HIWORD(lParam));
InvalidateRect(hWnd, &rectButton, TRUE);
break;
case WM_LBUTTONUP:
wsprintf(ButtonText, "WM_LBUTTONUP: %x, %d, %d",
wParam, LOWORD(lParam), HIWORD(lParam));
InvalidateRect(hWnd, &rectButton, TRUE);
break;