Keep one MDI child window always at the back

In my Clarion Desktop app using an AppFrame, Is there a way to keep one of my child windows always at the back? I don’t ever want that MDI Child window to come in front of any of my other MDI Child windows.

So question - if it is always in the back - why is it a window? Why not a START THREAD Source procedure?

But you don’t really give “use” context.

You can Hide the window
You can minimize the window
You can on event:gainfocus, post event:losefocus

So, it’s a menu window? And you want it at the back so it doesn’t take up real estate on the screen?
Well, it doesn’t need to be MDI? So, don’t START it?

OK, that wasn’t such a good idea.

This API.

This works on a timer for your mid child menu window.

Loc:Bool = IS_SetWindowPos(0{Prop:Handle},EQ:HWND_BOTTOM,0,0,0,0,EQ:SWP_NOSIZE + EQ:SWP_NOMOVE + EQ:SWP_NOACTIVATE)

I don’t think that Post would cause the Window to Lose Focus.

Maybe in Event:GainFocus call API SetWindowPos() with HWND_BOTTOM Places the window at the bottom of the Z order

SetWindowPos(0{Prop:Handle}, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE + SWP_NOACTIVATE)

That would not keep it under all other MDI children continuously, just stop it from taking focus which could have of the user clicked on it or due to another window closing.

I would also be concerned if it was the only window open then this code would run repeatedly. So some way to stop that by knowing there are no other windows.


You would want all the controls on that window to have the SKIP attribute so they would not try to take focus.

I wrote a template nearly 10 years ago to use a window as a dummy frame background. This is a demo of using that technique and enabling disabling the window so the user can interact with it if necessary…

This is all you need to keep a MDI child window at the back of all the other MDI child windows.

Loc:Bool = IS_SetWindowPos(0{Prop:Handle},EQ:HWND_BOTTOM,0,0,0,0,EQ:SWP_NOSIZE + EQ:SWP_NOMOVE + EQ:SWP_NOACTIVATE)

Where it gets placed on that window is down to the individual requirements. A timer event embed is brute force, the event:gainfocus embed is perhaps better provided the API doesnt mess around with controls that have focus.

Other tricks include not having a window title, which then stops the max, restore, close buttons from being available to click on, and keeps it out of the window list of mdi child windows found on the main frame.

There’s always more than one way to skin a cat! I’m happy with the technique I posted, unless you see a problem with it?

Dont know enough about the window that needs to stay at the back. It could be a window with buttons on, in effect being a menu of sorts, it could be just to display pics and graphs, it could be like yours, to display branding of sorts.

Sure there’s always more than one way to skin a cat, because nothing is absolute.