How can I call another application from my Delphi service?

前端 未结 3 1932
你的背包
你的背包 2020-12-19 11:53

I\'ve made a service with Delphi. Every time I call another application in that service the application is not running. What is wrong?

BTW I have used shellexecute,

3条回答
  •  伪装坚强ぢ
    2020-12-19 12:49

    Services run in a different session from the interactive user. Services run in session 0. Session 0 processes do not have access to the interactive desktop. Which means that any attempt to show an interactive process in session 0 is doomed to fail. You are attempting to create a Notepad process which is interactive.

    There are ways to launch a process on an interactive desktop from a session: Launching an interactive process from Windows Service in Windows Vista and later. As you will understand after reading that article, what you are attempting to do is non-trivial.

提交回复
热议问题