THIS is retarded... or i am
I can''t get the window to redraw itself... I JUST CAN"T!!! i''ve been trying for a month... and its not working!
well, just call invalidaterect or Send/Postmessage (don''t sure the last thing''ll work though) and make sure you capture the WM_PAINT message in the message proc
i''ve been trying, updatewindow() redrawwindow() and InvalidateRect()... where exactly should i place it, and if i''m doing it in the right place i''m probably using the wrong parameters... anyone got a tutorial or something?
Are you also capturing the WM_PAINT commands in your windows procedure?
If you are, then you can put a MessageBox() call in your WM_PAINT to see if it is being called when you expect it to. Or you can set up a log file and log WM_PAINT calls. If that doesn''t help you will have to post some code.
Make it work, then
make it fast.
"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book
If you are, then you can put a MessageBox() call in your WM_PAINT to see if it is being called when you expect it to. Or you can set up a log file and log WM_PAINT calls. If that doesn''t help you will have to post some code.
Make it work, then
make it fast.
"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book
assumes wndHandle is a valid HWND for your windowIn the message handler:HDC dc;...case WM_PAINT: PAINTSTRUCT paintInfo; dc = BeginPaint(wndHandle, &paintInfo); // paint the window EndPaint(wndHandle, &paintInfo); return 0;case WM_ERASEBKGND: return 1; // only needed if you don't want windows to erase the window for you - it can cause flickering if you let windows erase the window and you have an interactive frame-rate...In WinMain (or wherever your main loop is):...MSG msg;while (running){ PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); TranslateMessage(&msg); // only needed if you want text input through WM_CHAR DispatchMessage(&msg); InvalidateRect(wndHandle, 0, NULL);// or possibly (wndHandle, NULL, 0)// means the same thing though, since NULL is basically 0}...
Works for me...
Hope that helps,
John B
[edited by - JohnBSmall on December 5, 2002 3:10:09 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement