Service starting a process wont show GUI C#

前端 未结 4 714
自闭症患者
自闭症患者 2020-11-28 11:58

Hey, I am trying to get a service to start my program but it isn\'t showing the GUI. The process starts but nothing is shown. I have tried enabling \'Allow service to intera

4条回答
  •  旧时难觅i
    2020-11-28 13:03

    I know this is a late post, but I found that this article was very helpful to me. I am running Windows 7 and the solution provided in this article works great.

    If you download the code, there is a class called ApplicationLoader. Include that class in your project and then it's as simple as this:

    // the name of the application to launch
    String applicationName = "cmd.exe";
    
    // launch the application
    ApplicationLoader.PROCESS_INFORMATION procInfo;
    ApplicationLoader.StartProcessAndBypassUAC(applicationName, out procInfo);
    

提交回复
热议问题