Drawing in window

Ive drawn an object using BeginPaint(), on certain key presses the object changes, but the window doesnt update the display untill i cover the window with another and then show it again.

how do i get the window to repaint on every cycle without regardless of anything else( my structure has a repaint function within the WM_PAINT switch)

i need this because eventualy the object will be changing without interaction from a user.
[448 byte] By [John_M_Gough] at [2007-11-20 11:34:25]
# 1 Re: Drawing in window
Handle a WM_KEYDOWN message and when your key is pressed simply add the function -
Invalidate(WindowHandle, NULL, true);

Hope this helps.
.pcbrainbuster at 2007-11-9 13:32:49 >
# 2 Re: Drawing in window
pcbrainbuster I found that the function was InvalidateRgn(hwnd, NULL, true). you led me in the right direction and im greatfull, Thankyou.
John_M_Gough at 2007-11-9 13:33:49 >
# 3 Re: Drawing in window
Woops, lol it was a typo, I was meant to type InvalidateRect. But if you set-up a region then you use InvalidateRgn, I think :p.
.pcbrainbuster at 2007-11-9 13:34:47 >