13 12 月, 2007

如何使MFC的MDI默认不创建空child窗口

[color=#008000]// Parse command line for standard shell commands, DDE, file open[/color]
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
[color=#008000]// 防止开启后自动创建child[/color]
[color=#0000D0]if[/color] (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew)
{
[color=#0000D0]if[/color] (cmdInfo.m_strFileName==[color=#808080]””[/color])
{
cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
}
}
[color=#008000]// Dispatch commands specified on the command line[/color]
[color=#0000D0]if[/color] (!ProcessShellCommand(cmdInfo))
[color=#0000D0]return[/color] [color=#0000D0]FALSE[/color];
本代码由xTiNt自动着色 http://kbadboy.yeah.net