Print Page | Close Window

Non-restoreable Ribbon-MDIs...

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=11266
Printed Date: 12 December 2024 at 10:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Non-restoreable Ribbon-MDIs...
Posted By: znakeeye
Subject: Non-restoreable Ribbon-MDIs...
Date Posted: 01 July 2008 at 8:33am
I want my ribbon-MDIs to always be maximized. I solved this by overriding ActivateFrame() in my frame window, setting nCmdShow = SW_SHOWMAXIMIZED. Also, I added this in CMainFrame:

m_MTIClientWnd.ShowWorkspace(FALSE);
pCommandBars->GetMenuBar()->SetFlags(xtpFlagHideMinimizeBox | xtpFlagHideMaximizeBox);

I thought my MDIs were safe, but no... Alt+'-' causes a context menu to appear with the options "restore", "minimize" and "close". How do I prevent this menu from appearing?
 
Added image (WS_SYSMENU removed):



Replies:
Posted By: Oleg
Date Posted: 01 July 2008 at 1:03pm
Hi,
 
Catch WM_SYSCOMMAND + SC_KEYMENU/SC_MOUSEMENU.
 
Or better remove these commands from SystemMenu. pWnd->GetSystemMenu()->etc.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 01 July 2008 at 7:32pm
Please see image in original post!
 
The items are re-enabled by the framework. However, this works: 
cs.style &= ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX);
 
Though, the "Move" command is still available. I can live with that, but how would you delete the menu alltogether?
 
Note that removing WS_SYSMENU yields a menu with an empty menu item (bug in Toolkit or MFC?) when pressing Alt+'-'. I tried this in a new MFC-MDI-app and got a lockup instead... crazy.


Posted By: Oleg
Date Posted: 02 July 2008 at 1:10am
Hi,
I didn't write "disable" I wrote "remove" :-)
 
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
  return -1;
 
 CMenu* pMenu = GetSystemMenu(FALSE);
 pMenu->RemoveMenu(SC_RESTORE, MF_BYCOMMAND);
 pMenu->RemoveMenu(SC_MINIMIZE, MF_BYCOMMAND);
 pMenu->RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND);
 pMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
 pMenu->RemoveMenu(SC_SIZE, MF_BYCOMMAND);
 
 return 0;
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 02 July 2008 at 10:06am

Did you try it? ;)

"Move" (with text this time) is still there after executing your code, even though all menu items have been removed. How is this possible?!


Posted By: Oleg
Date Posted: 02 July 2008 at 10:13am
Hi,
just tried with Ribbon MDI Sampe. Works.
Did you try? ;-)


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 04 July 2008 at 12:56am
Could my problem have something to do with my CXTPTabClientWnd in CMainFrame? I really can't get rid of the "Move" item!


Posted By: Oleg
Date Posted: 04 July 2008 at 1:28am
Hi,
 
Ribbon MDI sample also has it. Can you modify one of sample, reproduce problem and attach here?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net