Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Problem with controls in the window, please help!!!!!

Hi!

- My program handles the WM_ERASEBKGND message in the window callback procedure, to paint the background of the window. /It puts out a BMP picture/
- In the WinMain, i also put out a couple controls, like buttons, edit boxes, etc.

The problem:When the controls are drawn to the screen, WM_ERASEBKGND gets called, and erases the controls. Also, when the window is minimized, then restored, the controls are not viewable. What a heck i'm doing wrong?
/I alo tried to filter out the WM_ERASEBKGND messages sent to clear the background of the controls, and in those cases i called the DefWindowProc. In that case initially the controls are viewable, but i still have the same problem upon minimizing-restoreing the window, the controls are erased (not erased, just not painted. If you click on them, they reappear.)/

Edocecrous

ps.:So what the heck is responsible for repainting the controls?


Comments

  • pingpongpingpong Posts: 937Member
    Try adding WS_CLIPCHILDREN in your main window styles.
  • edocecrousedocecrous Posts: 49Member
    It lives, IT LIVES!!!!!
    Thanks, you are the best... ...I was wasting time for 3 days because of this stupid error. It's always like this. I'm writing a 32bit disassembler in assembly, and so on... ...and i sometimes can't find a stupid mistake. When you look at your code the 1000x times, it's hard to find an error you made at line 3. :-)

    Thanx again!

    Edocecrous

    ps.:Do you happen to know, how could i get access to a DirectX program's secondary surfaces? /The specific case is, i'd like to take a peek at the game, Diablo's (the first one, writen in DX3) secondary surfaces.

Sign In or Register to comment.