Вот кусок кода, в котором вывод текста в окно
[code=c++]void Thread(void*pParams)
{
     RECT rect;
     MSG message;
     GetClientRect(hMainWnd, &rect); 
     HDC hDC = GetDC(hMainWnd); 
     while(true)
     {
     if (PeekMessage(&message, hMainWnd, 0, 0, PM_REMOVE)) { 
TranslateMessage(&message); 
DispatchMessage(&message); }
     Sleep(1000);
     system_time=time(NULL);
     InvalidateRect(hMainWnd,&rect, false);
     }
     ReleaseDC(hMainWnd,hDC);
}
[/code]
и ещё непосредственно из функции WndProc
[code=c++]
switch (uMsg) 
     { 
         case WM_PAINT: 
          hDC = BeginPaint(hWnd, &ps);
          SetBkMode(hDC, TRANSPARENT); 
          GetClientRect(hWnd, &rect);
          system_time=time(NULL);
          DrawText(hDC, ctime(&system_time), -1, &rect, DT_SINGLELINE | DT_CENTER |  DT_VCENTER); 
          EndPaint(hWnd, &ps);
          _beginthread(Thread, 0 , NULL);
          break;  
         break;
[/code]
Ну и заодно полный листинг  
