Need help in understanding behavious or multiple child windows

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Need help in understanding behavious or multiple child windows

    Hi,

    I have 3 child windows located at (15,15) with size (320,240). All 3 windows belong to same parent and created with WM_CreateWindowAsChild().
    Each window has an OK button , if touched, it closes that respective window with WM_DeleteWindow();
    All child window's callback routine is having WM_MakeModal(pMsg->hWin) in their WM_PREPAINT case.

    Problem:
    When 3 windows are drawn on the top of each other, I press on OK button on Topmost window which closes that window. Now Im not able to press on OK button of middle window. The window doesnt receive any messages.
    Just for checking i shifted bottom window little so that i could press on OK button. So i observed that, bottomost window was active and i was able to press on OK button. After pressing that window got closed and then only middle window got active and then i was able to press on that window.
    Why it happened ?
    I was expecting that when i press on OK button of topmost window, it should get closed. Then i should be able to press on OK button of middle window. After press it should get deleted. And then the bottommost window should get active & and on pressing OK button of it, it should get deleted.
    But this is not happening.

    Please guide me here in understanding the behaviour.
  • [Solved] Need help in understanding behavious or multiple child windows

    Dear Sven,

    Thank you so much for your kind reply and guidance. So It looks like WM_PRE_PAINT gets called everytime when redrawing is needed and that's what causing this behaviour. I'll avoid calling it from there and check the behaviour.
    Thanks :)