VS2010窗口的最大化
来源:互联网 发布:淘宝客导购app开发 编辑:程序博客网 时间:2024/05/22 17:30
我们知道,在vc6中窗口最大化只用下面的代码就可以实现:
BOOL CTestvc6App::InitInstance(){AfxEnableControlContainer();// 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.#ifdef _AFXDLLEnable3dControls();// Call this when using MFC in a shared DLL#elseEnable3dControlsStatic();// Call this when linking to MFC statically#endif// 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"));LoadStdProfileSettings(); // Load standard INI file options (including MRU)// Register the application's document templates. Document templates// serve as the connection between documents, frame windows and views.CSingleDocTemplate* pDocTemplate;pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,RUNTIME_CLASS(CTestvc6Doc),RUNTIME_CLASS(CMainFrame), // main SDI frame windowRUNTIME_CLASS(CTestvc6View));AddDocTemplate(pDocTemplate);// Parse command line for standard shell commands, DDE, file openCCommandLineInfo cmdInfo;ParseCommandLine(cmdInfo);// Dispatch commands specified on the command lineif (!ProcessShellCommand(cmdInfo))return FALSE;// The one and only window has been initialized, so show and update it.m_pMainWnd->ShowWindow(SW_MAXIMIZE);m_pMainWnd->UpdateWindow();return TRUE;}
然而在vc2010中,这样做是不会最大化窗口的,那么它的实现方法是什么呢?加入一句话就行了:
BOOL Ctestvs2010App::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);CWinAppEx::InitInstance();// Initialize OLE librariesif (!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 organizationSetRegistryKey(_T("Local AppWizard-Generated Applications"));LoadStdProfileSettings(4); // Load standard INI file options (including MRU)InitContextMenuManager();InitKeyboardManager();InitTooltipManager();CMFCToolTipInfo ttParams;ttParams.m_bVislManagerTheme = TRUE;theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);// Register the application's document templates. Document templates// serve as the connection between documents, frame windows and viewsCSingleDocTemplate* pDocTemplate;pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,RUNTIME_CLASS(Ctestvs2010Doc),RUNTIME_CLASS(CMainFrame), // main SDI frame windowRUNTIME_CLASS(Ctestvs2010View));if (!pDocTemplate)return FALSE;AddDocTemplate(pDocTemplate);CleanState(_T("WorkSpace"));// Parse command line for standard shell commands, DDE, file openCCommandLineInfo cmdInfo;ParseCommandLine(cmdInfo);// Dispatch commands specified on the command line. Will return FALSE if// app was launched with /RegServer, /Register, /Unregserver or /Unregister.if (!ProcessShellCommand(cmdInfo))return FALSE;// The one and only window has been initialized, so show and update itm_pMainWnd->ShowWindow(SW_MAXIMIZE);m_pMainWnd->UpdateWindow();// call DragAcceptFiles only if there's a suffix// In an SDI app, this should occur after ProcessShellCommandreturn TRUE;}
这样就会实现窗口的最大化。
- VS2010窗口的最大化
- 另类的最大化窗口
- 窗口的最大化最小化
- 窗口最大化的严格定义
- javascript 自动控制窗口的最大化
- 最大化窗口的大小设置
- 关于窗口最大化的状态
- 六、窗口最大化的方法
- jquery 实现窗口的最大化
- 改变窗口最大化的尺寸
- MFC窗口最大化的问题
- 最大化窗口
- 窗口最大化
- 控制MDI窗口的,最大化.最小化按钮!
- open出最大化的窗口(模仿)
- 限制窗口的最大化和不可移动
- VC++MFC 窗口最大化、最小化的实现
- 限定窗口最大化和最小化的大小
- poj 1151 && hdu 1542 离散化求矩形面积的并
- 多种系统exe打开方式还原的详细方法
- linux下带有CDT的Eclipse的helloworld编译错误的解决方法
- 一个很好的对8086cpu的Assembly的编写和调试教程&&Flags Register
- SQL SERVER问题解决:已成功与服务器建立连接,但是在登录过程中发生错误。 (provider: 命名管道提供程序, error: 0 - 管道的另一端上无任何进程。)
- VS2010窗口的最大化
- oracle 连表查询时的数据类型问题
- 动态规划入门(三)DP 基本思想 具体实现 经典题目 POJ1159 POJ1458 POJ1141
- vim操作技巧
- 安装APK时报Local path doesn't exist错误
- YUV12和YUV2格式
- 弹出窗口返回数据给父窗口
- 小技巧
- c++中strsub()的用法