Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flickering in a dialog based project....

Status
Not open for further replies.

nexius

Programmer
Jul 8, 2000
109
CA
Hey

I'm trying to get rid of this annoying flickering effect whenever the window of my dialog box is updated, and I've succeeded in doing this, using BitBlt and such...

But control windows that are in the form, like buttons for example, still flicker ... I'd like to disable windows from erasing the background by overriding the WM_ERASEBKGND message, but how do you do this for something like a button??

THANKS
 
You should do all your painting to a memory DC then when your painting is complete blt the memdc to the paint DC.
To answer your second question you can use GetWindowLong to get the WNDPROC for the button in question and use SetWindowLong to replace it with one of your own. Any messages that need default processing should then be passed to the old WNDPROC.
 
Thanks for your reply

However I'm not sure how to use GetWindowLong and SetWindowLong to achieve this effect...

MSDN doesn't seem to have much info on these methods either

Could you elaborate on how to do this a bit more?

Thanks again.
 
What are you struggling with. GetWindowLong takes two params, the HWND of the button and an int index which for you will be GWL_WNDPROC.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top