News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

API to freeze screen before updating it

Started by newAsm, June 09, 2010, 10:07:08 AM

Previous topic - Next topic

newAsm

Hi,

I am asking a stupid question but I am not sure which API is the best. I want to prevent the screen flickering when I am doing drawing on the application window. Which API should I use to save the desktop or application window and then release it for update. Your knowledge would be helpful.

Thanks..newAsm

Tedd

Try WM_SETREDRAW, but it depends what you're drawing on.


invoke SendMessage, hCtrl,WM_SETREDRAW,FALSE,0
;...do your drawing/modifying...
invoke SendMessage, hCtrl,WM_SETREDRAW,TRUE,0


If you're drawing to the DC yourself, you should create a memory DC, draw to that, and then bitblt to the window DC in one go when you're finished.
No snowflake in an avalanche feels responsible.

Ghandi

Yep, double buffering is the way to go if you want to minimize or prevent screen flicker. Tedd is absolutely correct, do your manipulations on the memory DC and then a single BitBlt will paint it in one operation.

HR,
Ghandi

sysfce2