下你所需,载你所想!
汇集开发技术源码资料

c++以管理员身份运行程序

:383B :1 :2022-10-03 14:16:39

部分简介

c++以管理员身份运行程序如果开发者对于本文件有需要的可以参考。

SHELLEXECUTEINFO ShExecInfo = { 0 };

ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_DEFAULT;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = _T("runas");
ShExecInfo.lpFile = “需要运行的程序”;
ShExecInfo.lpParameters = _T("");
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;

ShExecInfo.hInstApp = NULL;
if(!ShellExecuteEx(&ShExecInfo))
GetLastError();

热门推荐

相关文章