while(GetMessage( &msg, hWnd, 0, 0 ) >0)
{
  TranslateMessage(&msg);
  DispatchMessage(&msg);
}