启动一个带参数的进程

D:\SixCocos2d-xVC2012\Cocos2d-x\XWH>CP Un.exe
1 2 3 4
2 1 4 3
3 4 1 2
4 3 2 1
1 2 3 4 5 6 7 8
2 3 5 8 1 4 6 7
3 5 1 7 2 8 4 6
4 8 7 3 6 2 1 5
5 1 2 6 3 7 8 4
6 4 8 2 7 1 5 3
7 6 4 1 8 5 3 2
8 7 6 5 4 3 2 1
请按任意键继续. . .

D:\SixCocos2d-xVC2012\Cocos2d-x\XWH>CP "calG C2D3.txt"
G12ElementToOrder(0)=1
G12ElementToOrder(1)=2
G12ElementToOrder(2)=2
G12ElementToOrder(3)=3
G12ElementToOrder(4)=3
G12ElementToOrder(5)=2
G12ElementToOrder(6)=2
G12ElementToOrder(7)=2
G12ElementToOrder(8)=2
G12ElementToOrder(9)=6
G12ElementToOrder(10)=6
G12ElementToOrder(11)=2
C2D3有1个1阶元,7个2阶元,2个3阶元,0个4阶元,2个6阶元,0个12阶元
分析群的结构完毕!

// 启动一个带参数进程
#include
#include

int main(int argc, char* argv[]){
    if(argc<2){
        printf("Usage:  CP \"*.exe [arg1][arg2]\"\n");
        return 0;
    }
    PROCESS_INFORMATION ProcessInfo;
    STARTUPINFO   StartupInfo;
    ZeroMemory(&StartupInfo,sizeof(StartupInfo));
    StartupInfo.cb=sizeof(StartupInfo);
    if(CreateProcess(NULL,argv[1],NULL,NULL,FALSE,0,NULL,NULL,&StartupInfo,&ProcessInfo)){
        WaitForSingleObject(ProcessInfo.hProcess,INFINITE);    
        CloseHandle(ProcessInfo.hThread);
        CloseHandle(ProcessInfo.hProcess);        
    }
    return 0;
}

你可能感兴趣的:(C++,GO端游,手游开发)