I’m making a wpf app (,net framework) which hosts an external app (mfc program), to host it I’m using a WindowsFormsHost control and the SeParent function from pInvoke like that:
int style = GetWindowLong(_hostedAppHwnd, GWL_STYLE);
_ = SetWindowLong(_hostedAppHwnd, GWL_STYLE, (int)(style & ~(WS_CAPTION | WS_SIZEBOX) | WS_CHILD));
SetParent(_hostedAppHwnd, _windowsFormsHost.Handle);
//It doesn't work
var hMenu = GetMenu(_hostedAppHwnd);
SetParent(hMenu, _mainWindowHwnd);
All is working fine except if set the WS_CHILD flag I loose the sys menu (top menu) of the hosted application as expected because it has the WS_CHILD flag.
Anyone know if it’s possible, to “move” the hosted app’s menu to the main application?
Thanks in advance