用这个看看吧
Corresponds to the lpCmdLine parameter passed by Windows to WinMain.
LPTSTR m_lpCmdLine;
Remarks
Points to a null-terminated string that specifies the command line for the application. Use m_lpCmdLine to access any command-line arguments the user entered when the application was started. m_lpCmdLine is a public variable of type LPTSTR.
Example
BOOL CMyApp::InitInstance()
{
// ...
if (m_lpCmdLine[0] == _T('\0'))
{
// Create a new (empty) document.
OnFileNew();
}
else
{
// Open a file passed as the first command line parameter.
OpenDocumentFile(m_lpCmdLine);
}
是不是主要起作用的就是
cmdInfo.m_nShellCommand = CCommandLineInfo::FileOpen;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
ProcessShellCommand(cmdInfo);
//Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
//Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
cmdInfo.m_nShellCommand=CCommandLineInfo::FileOpen;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
ProcessShellCommand(cmdInfo);