![]() |
Remove close button from system menu |
Post Reply
|
| Author | |
Gonzo
Newbie
Joined: 17 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: Remove close button from system menuPosted: 07 January 2008 at 5:15pm |
|
I am currently using Office2007 theme with
CXTPDialogBase<CXTResizeDialog> and CXTPOffice2007FrameHook I am trying to get rid of the close button in the system menu which is usually done like this; however, this does not seem to work. Any suggestions? CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) pSysMenu->RemoveMenu(SC_CLOSE,MF_BYCOMMAND); |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2008 at 1:50am |
|
HI, You can remove whole sysmenu : remove style WS_SYSMENU
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Gonzo
Newbie
Joined: 17 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2008 at 9:15am |
|
Hi,
I don't want to remove the whole system menu. I would just like to disable or remove the close button. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2008 at 3:11pm |
|
Hi,
to disable you can set MF_DISABLED state for SC_CLOSE command.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Gonzo
Newbie
Joined: 17 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2008 at 7:20pm |
|
Hi,
The above solution functions as long as I do not have "EnableOffice2007Frame(pCommandBars)" in my code. I would like to maintain this frame for my look and feel. Here is a little more code to debug the problem. #define CDialogDlgBase CXTPDialogBase<CXTResizeDialog> BOOL CMyApp::OnInitDialog() { CDialogDlgBase::OnInitDialog(); // Init the menus VERIFY(InitCommandBars()); CXTPCommandBars* pCommandBars = GetCommandBars(); LoadCommandBars(_T("CommandBars")); // Set the Office 2007 theme CXTPPaintManager::SetCustomTheme(new CXTPOffice2007Theme()); EnableOffice2007Frame(pCommandBars); pCommandBars->RedrawCommandBars(); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) pSysMenu->EnableMenuItem(SC_CLOSE, MF_DISABLED); return TRUE; } |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 January 2008 at 11:51am |
|
Hello,
It works for me.
Maybe your have older version and it was added after.
|
|
|
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 |