zoukankan      html  css  js  c++  java
  • 关于CreateProcess函数一些经验

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    TCHAR szCmdLine[]={TEXT("E:\CPL-server\其他工具\restartSrv\bin\opensavepath.exe")};
    TCHAR static szCommandLine[MAX_PATH + 700] = {0};
    lstrcpy(szCommandLine, pProgramPath);
     
    STARTUPINFO si = {0};
    ZeroMemory(&si, sizeof(si));
    si.cb = sizeof(STARTUPINFO);
    GetStartupInfo(&si);
    si.wShowWindow = SW_SHOW;
    si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
     
    // 运行进程
    PROCESS_INFORMATION pi;
    ZeroMemory(&pi, sizeof(pi));
     
    BOOL bRet = FALSE;
    bRet = CreateProcess(pProgramPath, NULL, NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi);
     
    ///<关闭Restartsrv不会关闭创建进程子窗口>
    //BOOL bRet = CreateProcess(
    //  NULL,                   // name of executable module
    //  szCmdLine,          // command line string
    //  NULL,                   // process attributes
    //  NULL,                   // thread attributes
    //  FALSE,                  // handle inheritance option
    //  CREATE_NEW_CONSOLE,                     // creation flags
    //  NULL,                   // new environment block
    //  NULL,                   // current directory name
    //  &si,                    // startup information
    //  &pi);                   // process information
     
    if( bRet )
    {
        CloseHandle(pi.hThread);
        CloseHandle(pi.hProcess);
    }
     
    //ShellExecute(NULL, "open", szCmdLine, NULL, NULL, SW_SHOWNORMAL);
     
    return bRet;

    jpg 改 rar 

  • 相关阅读:
    ural(Timus) 1019 Line Painting
    ACMICPC Live Archive 2031 Dance Dance Revolution
    poj 3321 Apple Tree
    其他OJ 树型DP 选课
    poj 3548 Restoring the digits
    ACMICPC Live Archive 3031 Cable TV Network
    递归循环获取指定节点下面的所有子节点
    手动触发asp.net页面验证控件事件
    子级Repeater获取父级Repeater绑定项的值
    没有列名的数据绑定
  • 原文地址:https://www.cnblogs.com/kuangke/p/9524353.html
Copyright © 2011-2022 走看看