This line is missing

Code:
wndclass.lpfnWndProc = WndProc;
Also, your WndProc function is not proper.
It should have a switch statement to check the message parameter

Code:
switch (message)
{
   case WM_PAINT:
      hdc = BeginPaint (hwnd, &ps);
      GetClientRect (hwnd, &rect);
      EndPaint(hwnd, &ps);

      break;

   default:
      return DefWindowProc (hwnd, message, wparam, lparam);
}