谢谢

解决方案 »

  1.   

    返回值如果大于2就是进程的HINSTANCE句柄,使用ShellExecuteEx或CreateProcess可以获得所建进程的更多信息
      

  2.   

    orbit(走了走了): 返回值如果大于2就是进程的HINSTANCE句柄
    对这句话表示怀疑。
    ==========================================================
    Return ValueReturns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an int and compare it with the value 32 or one of the error codes below
      

  3.   

    使用ShellExecuteEx函数创建,从该函数的SHELLEXECUTEINFO结构中的hProcess中可以得到进程句柄。
      

  4.   

    是32,写错了,HINSTANCE句柄是为了兼容而保存的,新的系统是否支持还不一定
      

  5.   

    用CreateProcess吧,可以获得创建进程的进程句柄,还有线程句柄,另外还有好多信息,创建进程的功能最强大
      

  6.   

    to 各位老大
    请问 CreateProcess 能否 打开 .msi  的文件?
    我是想监视一下 某些 安装程序
    我是XP系统谢谢
      

  7.   

    to goodname008(卢培培,充电中......) 
    请问能监视到  .msi  启动的安装进程吗?
    谢谢!
      

  8.   

    To yqzq(花心萝卜) :
    我也想用CreateProcess来,但是似乎是不行
    只能繁琐点咯SHELLEXECUTEINFO ShExecInfo;
    ZeroMemory( &ShExecInfo, sizeof( SHELLEXECUTEINFO ) );
    ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
    ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
    ShExecInfo.hwnd = NULL;
    ShExecInfo.lpVerb = NULL;
    ShExecInfo.lpFile = szFilePath;
    ShExecInfo.lpParameters = szParam;
    ShExecInfo.lpDirectory = NULL;
    ShExecInfo.nShow = SW_HIDE;
    ShExecInfo.hInstApp = NULL;
    ShellExecuteEx(&ShExecInfo);
    HWND hWnd = ::FindWindow("MsiDialogCloseClass",NULL);
    WaitForSingleObject(ShExecInfo.hProcess, INFINITE);其中szFilePath为文件全路径,szParam为该文件所带的参数