How to put a child window on Overlay window

From windows 2000 above, Windows supports a new kind of window style: WS_EX_LAYERED. This window style can draw window in semi-transparency or use to make irregular window.

SetLayeredWindowAttributes and UpdateLayeredWindow are two Windows APIs that relate to overlay window.

Layered window can have two drawing modes. One is the tranditional WM_PAINT message handling by the window itself. The other one is by setting a bitmap to the window by calling UpdateLayeredWindow, then windows will handle the drawing or updating of the window. The application itself will not even recieve the WM_PAINT message.

Now there is a problem. What if I put a child window on such a bitmap based layered window? I have tried to add a simple edit window as the child window of the layered window. The edit window can be created, but it cannot draw itself on the layed window.

After doing such research, I found a post on faking child window for a layered window. The basic idea is to create another popup window that will hold the edit control. When the layered window moves, move the popup window with it. So it looks just like child window.