如题

解决方案 »

  1.   

    system
    ShellExecute
    详见MSDN。
      

  2.   

    先用GetModuleHandle(...)获取你想调用的exe文件的路径,然后ShellExcutez(NULL,NULL,"The path that you've got ",NULL,NULL,SW_SHOWNORMAL).
    OK
      

  3.   

    ShellExecute(m_hWnd,NULL,"C:\\WINNT\\SYSTEM32\\CMD.EXE", NULL, NULL, SW_SHOWNORMAL);
    或者winexec(....);
      

  4.   

    1.ShellExecute(NULL,"open","C:\\...\\xxx.exe",NULL,NULL,SW_SHOWNORMAL);

    2.WinExec("C:\\...\\xxx.exe",SW_HIDE);
    UINT WinExec(
      LPCSTR lpCmdLine,  // address of command line
      UINT uCmdShow      // window style for new application
    );
     
    3.void C...Dlg::OnButton() 
    {
    STARTUPINFO StartupInfo; 
    PROCESS_INFORMATION ProcessInfo; 
    memset(&StartupInfo,0,sizeof(STARTUPINFO)); 
    StartupInfo.cb=sizeof(STARTUPINFO); 
    StartupInfo.dwFlags=STARTF_USESHOWWINDOW; 
    StartupInfo.wShowWindow=SW_SHOWMINIMIZED; 
    char* path="C:\\...\\xxx.exe";
    ::CreateProcess(NULL,path,NULL,NULL,FALSE,0,NULL,NULL,&StartupInfo,&ProcessInfo); 
    }
    4. system("C:\\...\\xxx.exe");