开发者

How to supply user information for CreateProcess?

开发者 https://www.devze.com 2023-03-20 17:26 出处:网络
How to supply user\'s information inside the CreateProcess function? Below is my current work. It seems cannot call my 开发者_如何学Cexternal exe. But when I run it manually inside console, it runs we

How to supply user's information inside the CreateProcess function? Below is my current work. It seems cannot call my 开发者_如何学Cexternal exe. But when I run it manually inside console, it runs well.

if (CreateProcess(parameterA.GetBuffer(), parameterB.GetBuffer(),0,0,TRUE,
          NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,0,0,&sInfo,&pInfo))
          {
            WaitForSingleObject (pInfo.hProcess, INFINITE);
          }

parameterA = "myapp.exe"; parameterB = " -i";


The first argument may be null - you specify the process path in the second argument only. Please show us what parameterB is. You also need to to initialize STARTUPINFO properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消