If you are drawing in a window outside of WM_PAINT (I guess in this case you are probably doing some GDI drawing on a timer when you get a WM_TIMER message), then you should call InvalidateRect() e.g.
InvalidateRect( hWnd, NULL, FALSE ); // invalidate whole window
This should cause Windows to redraw the whole window. If you have only written a small area, pass a RECT describing the area you have written.
If you want to draw when your windows procedure receives a WM_PAINT message AND for example, want to force that to happen every second, then set a timer...
#define SECOND_TIMER 1000
case WM_INITDIALOG:
SetTimer( hWnd, SECOND_TIMER, SECOND_TIMER, NULL );
//other initialisation stuff
break;
case WM_TIMER:
if( wParam == SECOND_TIMER )
{
InvalidateRect( hWnd, NULL, FALSE ); // invalidate whole window
}
break;
In this simple case the whole window should be redrawn every second since Windows will send a WM_PAINT message due to the InvalidateRect. Ideally you should only invalidate the part you are redrawing.