Tech Support > Microsoft Windows > Development Resources > SetParent function
SetParent function
Posted by Corno on August 21st, 2003


Hi all,

I've got a question about reassigning a child window.
If I create a child window with window A as a parent and then immediately
reassign that child window with SetParent to window B, is the net result
equal to creating the child window with window B as the parent?

Corno


Posted by Elias Fotinis on August 24th, 2003


Corno wrote:
No, it's not the same. There are two parents: one that contains the
child (graphically) and another that accepts its notification messages
(owner?). CreateWindow initially assigns both to the same hWnd. However,
SetParent changes only the first one (I recently read about that in
MSDN's "Using Toolbar Controls").

Parent/owner windows are a tricky subject