驱动中 或者 应用程序中 调用一个 .exe 可执行文件

来源:互联网 发布:网络信号发生器 编辑:程序博客网 时间:2024/05/20 18:44

#include "shellapi.h"

 

void LoadEXE(LPCTSTR strPath)

{
 SHELLEXECUTEINFO sei;  
 WIN32_FIND_DATA wfd;  
 HANDLE hFile=NULL;  
 hFile = FindFirstFile(strPath,&wfd);  
 if((hFile != INVALID_HANDLE_VALUE) && (hFile !=NULL))  
 {  
  FindClose(hFile);  
  ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));  
  sei.cbSize = sizeof(SHELLEXECUTEINFO);  
  sei.lpFile = strPath ;  
  sei.nShow = SW_SHOW;  
  ShellExecuteEx(&sei);  
 }  
 return;

}

 

使用例子

 LoadEXE(L"\\System\\powertest.exe");

原创粉丝点击