views:

165

answers:

2

I would like to host an application window from a process "A" into the main window of a process "B", just as if "A"'s window were a MDI child window. Is this possible in Windows? Or are there some tricks which would allow me to fake this?

By the way, I'd like to remove the title bar (or better yet, all the non-client stuff) of "A"'s window when it is embedded into "B"'s window. I suppose that this must be possible by tweaking the window styles or window classes, but I am by no means an expert in these Win32 intricacies.

+1  A: 

It's possible to host the Window. Change A's parent HWND by calling the SetParent function against it. To change the window styles, you need to use the GetWindowLong/SetWindowLong pair to change the attributes that you want to muck with.

If this is a third-party application (ie, not yours), then you're probably in for a rough ride, particularly if the window does any theming or anything custom with its window (for example, changes to the drag area, etc).

DannySmurf
A: 

After changing window's parent there are window painting troubles: when another window drag over "host" with child window, child window sometimes doesn't repaint. Does anybody know how to fix this issue?

N3tM4n
You should try to post this as a plain question, not an answer to a question. Stackoverflow does not work like this: the answers are not there to start a discussion, IMHO.
Pierre