首页 > 代码库 > CreateProcess启动隐藏的外部程序(其实就是CreateDesktop,然后指定STARTUPINFO.lpDesktop)

CreateProcess启动隐藏的外部程序(其实就是CreateDesktop,然后指定STARTUPINFO.lpDesktop)

 

[cpp] view plain copy
 
  1. HDESK hDesk = CreateDesktop(_T("MyDesk"), NULL, NULL, 0, GENERIC_ALL, NULL);  
  2. ASSERT(hDesk);  
  3. STARTUPINFO si = {sizeof(si)};  
  4. si.lpDesktop = _T("MyDesk");  
  5. si.dwFlags = STARTF_USESHOWWINDOW;  
  6. si.wShowWindow = SW_HIDE;  
  7. PROCESS_INFORMATION pi = {0};  
  8.   
  9. TCHAR szApp[MAX_PATH] = {_T("F://11.exe")};  
  10. if(CreateProcess(NULL, szApp, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))  
  11. {  
  12.  CloseHandle(pi.hThread);  
  13.  CloseHandle(pi.hProcess);  
  14. }  
 

http://blog.csdn.net/visualeleven/article/details/6025210 

 
 

 

CreateProcess启动隐藏的外部程序(其实就是CreateDesktop,然后指定STARTUPINFO.lpDesktop)