Service starting a process wont show GUI C#

前端 未结 4 713
自闭症患者
自闭症患者 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条回答
  •  野性不改
    2020-11-28 12:49

    This article explains Session 0 Isolation which among other things disallows services from creating a UI in Windows Vista/7. In your service starts another process, it starts in Session 0 and also will not show any UI. (By the way, the UI is created, it's just that Session 0 is never displayed). This article on CodeProject can help you create a process from a service on the user's desktop and show its UI.

    Also, please consider wrapping you stream objects in a using statement so that they are properly disposed.

提交回复
热议问题