![]() |
Non-restoreable Ribbon-MDIs... |
Post Reply
|
| Author | |
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
Topic: Non-restoreable Ribbon-MDIs...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); 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):
![]() |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
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?!
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 July 2008 at 10:13am |
|
Hi,
just tried with Ribbon MDI Sampe. Works.
Did you try? ;-)
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
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!
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |