Problem with controls in the window, please help!!!!! - Programmers Heaven

Howdy, Stranger!

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


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!!!!!


- 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.)/


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


  • AsmGuru62AsmGuru62 Posts: 6,519Member
  • 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!


    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.