Skip to main content
GameDev.net gamedev.net
🔒 Locked

LockWindowUpdate

Started by ageny6 Sep 29, 2003 at 1:52 PM 5 replies 6.3k views
Original Post
ageny6
ageny6
LockWindowUpdate is a great API. I always used it with great success. But, in my last project, calling the API causes my window to flicker upon refresh on every draw (which is not the intended effect ). This never happened before, and would like to know any possible insight as to why this is happening. Thanks Jonathan
My signature used to suck. But it's much better and more accurate now.
ageny6
ageny6
Am I getting no reply because no one knows about the API?

Jonathan
My signature used to suck. But it's much better and more accurate now.
ageny6
ageny6
I found this article online concerning the LockWindowUpdate API, and it said the following:

"MS does not recommend the use of the LockWindowUpdate API function for preventing drawing to a specific window while multiple updates are occurring. The preferred method is to use the the SendMessage API function along with the WM_SETREDRAW constant passing the hWnd of the specific window that should not be redrawn."

Is SendMessage better (faster) than LockWindowUpdate?


Jonathan
My signature used to suck. But it's much better and more accurate now.
ageny6
ageny6
Thanks, this helped alot.

But I do have one more question. If using LockWindowUpdate API is bad, how do you avoid multiple refreshed of a specific hdc when you have more than one drawing routines?

Say we are using a picturebox, the only manner I have found to make the drawing operation stay for the duration of one frame when invoking Bitblt (for example) is by setting the AutoRedraw bool to true. Is there then a faster way?

My signature used to suck. But it''s much better now.
My signature used to suck. But it's much better and more accurate now.
ageny6
ageny6
quote:
Original post by Anonymous Poster
if the memory bitmap is too big to blit all at once and stay within some pre-defined speed requirements, then a technique called dirty rectangles could be used to blit only those portions which have changed to the device DC.


When do I know when the memory bitmap is too big?



My signature used to suck. But it''s much better now.
My signature used to suck. But it's much better and more accurate now.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.