Announcement

Collapse
No announcement yet.

Allways on top, controls in DDT dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Allways on top, controls in DDT dialog

    I tried to use then %HWND_NOTOPMOST and %HWND_TOPMOST for a static control. (DDT)

    This control should stay beneat a few buttons while moveing it on the dialog.
    But it still shows itself above the buttons.

    How?


  • #2
    This is how I set my dialogs on top, not sure if it's exactly what you are doing though..You could make the button's WS_CHILD I suppose....


    SetWindowPos hDlg, %HWND_TOPMOST, 0, 0, 0, 0, %SWP_NOMOVE Or %SWP_NOSIZE


    ------------------
    Scott Turchin




    [This message has been edited by Scott Turchin (edited February 19, 2000).]
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      If my slow memory serves me right, you can't use %HWND_NOTOPMOST
      or %HWND_TOPMOST on static labels. Try setting %HWND_TOPMOST for
      the buttons instead.


      ------------------

      Comment


      • #4
        E.B. --

        I'm not clear about what you're asking, but here goes...

        > I tried to use then %HWND_NOTOPMOST and
        > %HWND_TOPMOST for a static control.
        > This control should stay beneat a few buttons
        > while moveing it on the dialog. But it still
        > shows itself above the buttons.

        1) Giving a window "topmost" status means that it will appear above everything else on the screen. Even other apps. The only way to get something to appear on top of a topmost window is to assign topmost status to another window, and then only that window will appear on top of the original, and both will appear on top of everything else on the screen. When you use %HWND_NOTTOPMOST you remove the topmost status from a window.

        2) I don't think that it is accepted practice -- or even possible -- to use the SetWindowPos API to change the topmost status of a control. As far as I know, you can only do that to a window, and all of the controls that are children of the window inherit the topmost or non-topmost status that is assigned. Imagine what could happen if a button was separated from its parent in that way. If the dialog was topmost and the button was not, I don't know whether or not it would always be visible. For example, if another app was given the foreground (but not topmost status) it seems like it would cover up the button, but not the dialog. And if the button was topmost and the parent window was not, the button could appear on top of other apps, and appear to be part of other apps. Or is that what you are trying to accomplish?

        3) If you are simply trying to change "what appears on top of what" on a normal dialog (forgetting about the actual "topmost" status), then the order in which DDT controls are created becomes important. If you create a button and then create a text box that overlaps it, it will cover up the button. And if you create the button second, it will cover up the text box.

        HTH.

        -- Eric

        ------------------
        Perfect Sync: Perfect Sync Development Tools
        Email: mailto:[email protected][email protected]</A>

        "Not my circus, not my monkeys."

        Comment


        • #5
          I guess the right answer is about that Static can't be on top

          Yes, i did put some controls above each other using setwindowpos but that was in a non-dialog where controls can't be child of another.

          I'll try a windowclass instead of a static.
          It's only used for painting.
          Mayb someone has experiance drawing in clipped rects?
          Then i wouldn't need a window(static) but the dialog only..
          (In this case only)



          ------------------

          Comment


          • #6
            In some cases, a control CAN be a parent of another... For example, a toolbar control - check out %WS_EX_CONTROLPARENT style, and dialog style %DS_CONTROL.

            In your case, you seem to be trying to speed up a paint event as discussed in another thread, so the best solution depends exactly on what you are trying to achieve.

            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment


            • #7
              I don't try to improve speed.

              (What do you mean)

              I just need a control or other method that i can draw things in a region while buttons may appear above it.

              Just a matter of time to figure a setclipregion or something out..


              ------------------

              Comment

              Working...
              X