CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Posts
    231

    Layered dialog, stay on top?

    Did anyone create a modeless dialog as a layered window and successfully made it stay "on top" (always visible) ? I can't make it work in Windows XP.

    I created a dialog class from CDialogEx, set the layered property to True in VS2010 resource editor, and added a call to SetLayeredWindowAttributes during OnInitDialog to make it transparent.

    Then by calling SetWindowPos with parameter &wndTop, I expect the window to stay on top.
    In Vista and Win7, the dialog stays on top as expected, but if I run the program in Windows XP and click inside a view in my MDI application, the dialog is drawn behind that child frame. Only if I compile without the Layered property, it stays on top in Win XP. Is this a limitation in Windows XP, or am I missing something?
    Last edited by TubularX; February 21st, 2012 at 11:11 AM.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Layered dialog, stay on top?

    Please upload a little demo project that can reproduce that behavior.
    It's not very clear which are your dialog styles and which is its relationship with other windows.
    From your description, it is a child of MDI client window, and AFAIK a child window cannot be layered.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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