Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3026

Can't click on controls/menu when detach MDI child out of MDI client area

$
0
0
Whole sample project can be found here: Sample project (https://drive.google.com/open?id=0Byc4Rs2GTQ1RSUI1bzIyNFlWWmc) Normal MDI child: Attachment 34857 (http://forums.codeguru.com/attachment.php?attachmentid=34857) MDI child is detached out of MDI client area: Attachment 34859 (http://forums.codeguru.com/attachment.php?attachmentid=34859) 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 (https://www.experts-exchange.com/questions/20358590/How-to-get-Clicks-on-a-form.html)). But I dont know where to begin. Any idea/ other approaches are welcome! The code I used to detach MDI child: Code: --------- 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); ---------

Viewing all articles
Browse latest Browse all 3026

Trending Articles