Mark Joy
asked on
Can't click on controls/menu when detach MDI child out of MDI client area
Whole sample project can be found here: Sample project
Normal MDI child:
MDI child is detached out of MDI client area:
Problem is after MDI child is detached, I am not able to click on menu/controls anymore.
I think one approach is to subclass winproc of MDI app, and then catching the messages and redirect them (like this one). But I dont know where to begin.
Any idea/ other approaches are welcome!
The code I used to detach MDI child:
Normal MDI child:
MDI child is detached out of MDI client area:
Problem is after MDI child is detached, I am not able to click on menu/controls anymore.
I think one approach is to subclass winproc of MDI app, and then catching the messages and redirect them (like this one). But I dont know where to begin.
Any idea/ other approaches are welcome!
The code I used to detach MDI child:
HWND MDIHwnd = pMainFrame->m_hWndMDIClient;
HWND mdiChildHwnd = GetWindow(MDIHwnd, GW_CHILD);
unsigned int style = GetWindowLongPtr(mdiChildHwnd, GWL_STYLE);
style = (style & (~WS_CHILD) | WS_POPUP);
SetWindowLongPtr(mdiChildHwnd, GWL_STYLE, style);
WaitForInputIdle(mdiChildHwnd, INFINITE);
SetParent(mdiChildHwnd, NULL);
WaitForInputIdle(mdiChildHwnd, INFINITE);
SetWindowLongPtr(mdiChildHwnd, GWLP_HWNDPARENT, (long)MDIHwnd);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
since you seem to be happy with this, i don't want object. however, it is rarely a good idea to overrule a high-level architecture (as it is with the mdi framework) by low-level message handling.
Sara
Sara
ASKER
Thank you for your comment.
Well, it is working without any problem. As I said, I don't have the source code of the MDI app, but I need to move its MDI child out of its MDI client area. Now if you have a better solution, I'm more happy to hear it out.
Well, it is working without any problem. As I said, I don't have the source code of the MDI app, but I need to move its MDI child out of its MDI client area. Now if you have a better solution, I'm more happy to hear it out.
ASKER
accepted answer
if you tell your requirements we probably could make suggestions how you could use a view as a popup-like window fo rthose purposes.
Sara