zoukankan      html  css  js  c++  java
  • ShellExecuteEx 阻塞和异步调用进程的两种方法

    阻塞:

    SHELLEXECUTEINFO ShExecInfo = { 0 };
    ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
    ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
    ShExecInfo.hwnd = NULL;
    ShExecInfo.lpVerb = NULL;
    ShExecInfo.lpFile = (LPCWSTR)newAppPath.utf16(); // _telegramPath.toLocal8Bit().constData();
    ShExecInfo.lpParameters = L"";
    ShExecInfo.lpDirectory = NULL;
    ShExecInfo.nShow = SW_SHOWNORMAL;
    ShExecInfo.hInstApp = NULL;
    ShellExecuteEx(&ShExecInfo);
    WaitForSingleObject(ShExecInfo.hProcess, INFINITE);

    异步:

    ShellExecuteA(NULL, "open", _telegramPath.toLocal8Bit().data(),telegramStartParm.c_str(), NULL, SW_SHOWNORMAL); 

    备注:SW_SHOWNORMAL表示管理员权限调用

  • 相关阅读:
    19软件工程专业---调查问卷
    软件工程2020思维导图
    关于创新创业
    学习周记
    学习周记
    问卷
    思维导图
    关于创新
    哈弗曼树
    调查问卷
  • 原文地址:https://www.cnblogs.com/gx1069/p/6740036.html
Copyright © 2011-2022 走看看