去掉系统菜单栏//在CDocApp::InitInstance()里注释掉pFrame->LoadFrame为什么不行?

mirroatl18 2012-11-10 12:12:07


BOOL CDocApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);

CWinApp::InitInstance();


// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}

AfxEnableControlContainer();

EnableTaskbarInteraction(FALSE);

// AfxInitRichEdit2() is required to use RichEdit control
// AfxInitRichEdit2();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));


// To create the main window, this code creates a new frame window
// object and then sets it as the application's main window object
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
//create and load the frame with its resources
pFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
// The one and only window has been initialized, so show and update it
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
return TRUE;
}
...全文
155 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
蒋晟 2012-11-10
  • 打赏
  • 举报
回复
难道用的是BCG的菜单栏?
mirroatl18 2012-11-10
  • 打赏
  • 举报
回复
我是要去的系统生成的窗口菜单
引用 1 楼 jiangsheng 的回复:
LoadFrame里很多工作的,要自定义菜单的话去重载CDocument::GetDefaultMenu。
蒋晟 2012-11-10
  • 打赏
  • 举报
回复
LoadFrame里很多工作的,要自定义菜单的话去重载CDocument::GetDefaultMenu。
schlafenhamster 2012-11-10
  • 打赏
  • 举报
回复
vc6正确运行的代码,到你哪里就“没有任何作用”了?
mirroatl18 2012-11-10
  • 打赏
  • 举报
回复
没有任何作用
引用 3 楼 schlafenhamster 的回复:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREA……
  • 打赏
  • 举报
回复
去掉系统样式就可以了
schlafenhamster 2012-11-10
  • 打赏
  • 举报
回复
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style &=~WS_SYSMENU; return TRUE; }

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧