Sunday, June 3, 2007

Difference Between Parent And Owner windows

Parent , Owner Windows Vc++
--------------------------------------------

We all know the relation ship between parent and child windows.
So if i ask you this question "What is the difference between Owner window andv owned window' ?? If you know the answer leave now.. No need to read the rest of the page. Otherwise you may find it interesting to read.

I don't want to write more about this topic.. Since this is a simple question..
Child window means , its drawing is limited to the parent region , and also it z order is also changed according to parent.

But if you consider owner windows it can draw outside the parent window region ,
But if you close the main Top-level window , both of these windows will close..

So when creating a child window using CreateWindow function , there is an option for providing parent for the window.

If you are creating a child window with WS_POPUP style that window automatically becomes a owner window, and it can draw outside the region)(means (o,0) position indicates top Left corner of desktop). Otherwise it is a normal child window.
That's it...