利用虚拟桌面无窗口启动进程
本文地址:http://tongxinmao.com/Article/Detail/id/509
void run_exe(const char *app)
{
char* szDesktop="MyDesktop";
//利用虚拟桌面隐藏运行
HDESK hDesk = CreateDesktop(szDesktop, NULL, NULL, 0, GENERIC_ALL|DESKTOP_CREATEWINDOW, NULL);
if(hDesk)
{
STARTUPINFO si = {sizeof(si)};
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow =SW_HIDE;// ; //SW_SHOW
si.lpDesktop = szDesktop;
PROCESS_INFORMATION pi = {0};
char *szApp =(char *) app;
if(CreateProcess(NULL, szApp, NULL, NULL, FALSE, 0, NULL,NULL, &si, &pi))
{
// CloseHandle(pi.hThread);
// CloseHandle(pi.hProcess);
}
else
{
ShowMessage("Failed.");
}
// CloseDesktop(hDesk);
}
}
run_exe("mspaint.exe");
上一篇:USB温度传感器 T0
下一篇:原始GPS坐标 (WGS-84)转换为 GCJ02坐标 和 BD09坐标 python源码