关于在MOBILE下打开其他进程

来源:互联网 发布:免备案域名加速 编辑:程序博客网 时间:2024/04/29 22:35

  1.用CreateProcess();

       例如要打开windows下的explorer:

      TCHAR szAppName[] = TEXT("//Windows//explorer.exe");
      TCHAR szAppCmd[]=L"close";
      int err=CreateProcess(szAppName,szAppCmd, NULL, NULL,false,0, NULL, NULL,NULL,NULL);
      if(err==0)
     {
         err=GetLastError();
         CString errr;
         errr.Format(L"%d",err);
         AfxMessageBox(errr) ;
    }

    2.用ShellExecuteEx();

     还是打开explorer:

      SHELLEXECUTEINFO te;
      memset(&te,0x00,sizeof(SHELLEXECUTEINFO));//清空内存的一定要加,不加会失败的。。。。。。
      te.lpFile=L"//Windows//explorer.exe";

      te.lpVerb=L"open";
      te.cbSize = sizeof(SHELLEXECUTEINFO);
      te.fMask  = SEE_MASK_NOCLOSEPROCESS;
      te.hwnd   = NULL;
      te.lpVerb = _T("open");
      te.nShow  = SW_SHOWNORMAL;


      ShellExecuteEx(&te);

 

原创粉丝点击