1
votes

So I created a parent window and then created a child window using CreateWindowEx. Now when I created the child window I gave it a style of WS_POPUP.

MSDN says:
WS_POPUP
0x80000000L
The windows is a pop-up window. This style cannot be used with the WS_CHILD style.

The window is a popup window, and is a child window of my other window. I guess I am confused with what the WS_CHILD style is for since I can still make my popup window a child of another window?

1

1 Answers

7
votes

A window with the WS_CHILD styling must stay within its parent's borders. A window with the WS_POPUP styling does not, and furthermore returns the owner window (rather than the parent window) when GetParent() is called.

Since the primary difference is whether or not the window has to stay within the parent window's borders, they are mutually exclusive and cannot be mixed, hence the note in the MSDN docs.