CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Guest

    Modeless dialog overdrawing all windows

    Hi, I recently converted a modal dialog to a modeless one. It works fine but always seems to be on top of any other windows no matter if it is active or not. In fact it even appears on the screen when it is inactive and another window is maximized. I believe was due to it having the WS_OVERLAPPED style.

    In order to stop this I have tried to set its style to WS_CHILD, but this seems to stop it from working at all. The contents of the dialog are displayed but do not respond to any events. If another window is dragged over it or maximized the dialog is painted over and disappears.

    There has to be a simple way to have a modeless dialog that does not stick on top of everything else. Unfortunately as my dialog was derived from a modal one I cannot see anyway other than to totally rewrite the entire creation and message handling code.

    Please help, thanks


  2. #2
    Guest

    Whoops..forgot to say this

    PS. I am not using MFC..


  3. #3
    Join Date
    Sep 1999
    Posts
    10

    Re: Modeless dialog overdrawing all windows

    The Modeless dialog will always on top of the windows. You have to rewrite the dialog as normal window and handle all the messages.


  4. #4
    Join Date
    Aug 2002
    Posts
    4

    Better late then never

    I ran accross this same problem myself. I found a work around that allowed parent and child dialogs to overlap one another.

    To implement the workaround create an invisible window as discussed in the following article:

    http://www.codesoup.com/asp/tiptext....n.pag&type=mfc

    Make the invisible window the parent of your child dialogs. Then the parent window can overlap the child window.

  5. #5
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725
    Well, in MFC you can set the parent window to GetDesktopWindow() when you create the
    modeless dialog to accomplish this.

    Maybe you do something along those lines in non-MFC.

  6. #6
    Join Date
    Sep 2002
    Posts
    1,747

    GetDesktopWindow

    Actually, GetDesktopWindow is an API exported from user32.dll! So should work fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured