child behind parent?

Everything else that doesn't fall into one of the other PB categories.
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

child behind parent?

Post by chi »

when i set a childwin to a parentwin the child is always in front...
any chance to reverse that? the child should always stay behind the parent!


thx for any ideas, chi
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Please tell a bit more about what you're trying to accomplish.
BERESHEIT
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Post by chi »

i have an external window and want to add a background-popup-window.
it should act like the parentwindow (minimize,close,...), but always stays behind the parent.

but 5min after posting i found this...
Owned Windows
An overlapped or pop-up window can be owned by another overlapped or pop-up window. Being owned places several constraints on a window.

An owned window is always above its owner in the z-order. <<- ;(

The system automatically destroys an owned window when its owner is destroyed.
An owned window is hidden when its owner is minimized.
Only an overlapped or pop-up window can be an owner window; a child window cannot be an owner window. An application creates an owned window by specifying the owner's window handle as the hwndParent parameter of CreateWindowEx when it creates a window with the WS_OVERLAPPED or WS_POPUP style. The hwndParent parameter must identify an overlapped or pop-up window. If hwndParent identifies a child window, the system assigns ownership to the top-level parent window of the child window. After creating an owned window, an application cannot transfer ownership of the window to another window.

Dialog boxes and message boxes are owned windows by default. An application specifies the owner window when calling a function that creates a dialog box or message box.

An application can use the GetWindow function with the GW_OWNER flag to retrieve a handle to a window's owner.
found a workaround... SetWindowRgn_

but if you know any better way, please tell me ;)


btw. netmaestro: thx for all the highquality code on the forum. helped me many times in many situations ...
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

Does it have to be a child window? If not, just create a 'normal' window that does what you want (You can even have it close/minimize etc with the 'parent' if you want to).

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Post by chi »

actually i tried that first. but its a thread in the background and i dont want to check too much stats like isiconic or foregroundwindow... so a child would come handy couse it works automatically.

my little workaround: child with a rectangle cut


edit: workaround is to slow with my 3dWindow... maybe a callback is the way :roll:


edit again: callback is definitely my friend! and i solved another problem by accident ;)
Post Reply