redrawing window without WM_PAINT (manually)?
my window will change and needs to be redrawn not necessarily on a WM_PAINT message. however, it doesn''t seem to be able to draw except during a WM_PAINT message. it is a dialog window, i''ve tried SendMessage(hWnd, WM_PAINT, ..., ...) with lots of things for ..., ... like GetDC(hWnd), and various PAINTSTRUCT things. how?
So, why not just do it in the main game loop? Some pseudo-code:
[edited by - andromeda on May 28, 2003 9:17:42 PM]
while(1){if PeekMessage(){Translate and Dispatch Messages()}//and then eitherGameLoop() <---do it in this function// ORFillRect(), etc. <-----do it all in the loop right here}
[edited by - andromeda on May 28, 2003 9:17:42 PM]
You need to call InvalidateRect();
EDIT: You're allowed to pass NULL as the second parameter if you want to update the entire window.
John B
[edited by - JohnBSmall on May 28, 2003 9:22:47 PM]
quote:From MSDN
The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.
BOOL InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);
EDIT: You're allowed to pass NULL as the second parameter if you want to update the entire window.
John B
[edited by - JohnBSmall on May 28, 2003 9:22:47 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement