I want my window to repaint itself over and over again, and I cant find out how to do it, can tell windows to send the WM_PAINT message over and over? or how can I do it? Thanks in advance.
I want my window to repaint itself over and over again, and I cant find out how to do it, can tell windows to send the WM_PAINT message over and over? or how can I do it? Thanks in advance.
Why drink and drive when you can smoke and fly?
UpdateWindow() may be what you're looking for.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Thanks, but where would I put the loop?
Why drink and drive when you can smoke and fly?
You could also use InvalidateRect(); and put it into the loop where you query the messages
What are InvalidateRect() 's parameters?
Why drink and drive when you can smoke and fly?
Code:BOOL InvalidateRect( HWND hWnd, // put here your window handle CONST RECT* lpRect, // if this is NULL the entire window gets an update BOOL bErase // if this is true the background will be erased );
Last edited by Onkel BeBu; 07-27-2003 at 11:03 AM.
To force a repaint, call InvalidateRect() to invalidate the portion of the window you wish to repaint (which puts a WM_PAINT message in the queue), and then immediately call UpdateWindow(), which forces the window procedure to process the WM_PAINT message.
You could use a timer to allow this code to be run over and over again. Look into SetTimer() and KillTimer(), and processing of the WM_TIMER message.
Questions like this should be directed at MSDN. Don't waste our time.Originally posted by Marcos
What are InvalidateRect() 's parameters?
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Agreed.Originally posted by bennyandthejets
Questions like this should be directed at MSDN. Don't waste our time.