有什么办法在Windows 7开始从Windows服务GUI应用程序? [英] Is there any way to start a GUI application from a windows service on Windows 7?

查看:208
本文介绍了有什么办法在Windows 7开始从Windows服务GUI应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了很多搜索以找到一种方法,从开始在Windows 7上一个窗口服务GUI应用程序的大部分我所发现的是,与Windows 7的服务,现在在一个单独的用户会话中运行,无法显示任何图形界面当前用户。我不知道是否有任何一种解决方法或完成像这样的不同的方式吗?该服务可以在不同的用户会话启动一个进程?

I have done a lot of searching to find a way to start a GUI application from a windows service on Windows 7. Most of what I have found is that with Windows 7 services now run in a separate user session and can not display any graphical interface to the current user. I'm wondering is there is any kind of workaround or different way of accomplishing something like this? Can the service start a process in a different user session?

推荐答案

这改变是有原因的,而不是简单地惹恼开发者。正确的做法是把你的用户界面在不同的程序,并通过管道会话,或其他一些IPC机制进行通信。该服务并不present UI的建议超过10岁了。

This change was made for a reason and not simply to annoy developers. The correct approach is to put your UI in a different program and communicate with the session through a pipe, or some other IPC mechanism. The recommendation that services do not present UI is more than 10 years old now.

您真的应该尽量遵循这些规则,即使它可能看起来不方便开始。从积极的一面,你将享受让你的业务逻辑和UI逻辑分离的好处

You should really try to follow these rules, even though it may seem inconvenient to begin with. On the plus side you will enjoy the benefit of keeping your service logic and UI logic separate

如果您的服务LocalSystem帐户下运行,那么你可以勾选允许服务与桌面交互,对于传统业务,如果他们不能显示用户界面,将失败的好处。但它不会帮你啦,因为用户界面将在会话0表明它是从未见过的!

If your services runs under the LOCALSYSTEM account then you can check "Allow service to interact with desktop", for the benefit of legacy services that would fail if they could not show UI. But it won't help you anyway because the UI will show in session 0 where it is never seen!

我建议你描述会话0隔离官方微软文档的读取。

I recommend you take a read of the official Microsoft document describing session 0 isolation.

这篇关于有什么办法在Windows 7开始从Windows服务GUI应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆