从Windows服务与网络日志上创建GUI [英] Create GUI from Windows Service with a Network Log on

查看:218
本文介绍了从Windows服务与网络日志上创建GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读了很多关于执行从Windows服务GUI应用程序。 允许服务与桌面交互复选框为我工作,当服务作为SYSTEM用户(我使用的是Windows XP)。
现在我需要的服务,以作为一个域(来自网络)中定义的用户运行。一切正常(即使没有用户登录到机器),但图形用户界面不显示(即使在同一网络用户登录!)。
我知道,图形用户界面运行,这只是他们是隐藏的。这是为什么?有没有办法向他们展示,如果用户登录(当系统用户创建,并允许与桌面交互一样!)?
如果是这样,将它如果登录用户不是一样的服务正在运行所述一个工作?

I have been reading a lot about executing a GUI application from a Windows Service. The "Allow service to interact with desktop" check box worked for me when the Service runs as the SYSTEM user (I am using Windows XP). Now I need the Service to run as a User defined in a domain (from the network). Everything works fine (even if no user is logged into the machine) but the GUIs are not shown (even if the same network user is logged in!). I know that the GUIs are running, it's just that they are hidden. Why is that? Is there a way to show them if a user is logged on (like when created by the SYSTEM user and allowed interaction with desktop!) ? if so, would it work if the user logged in is not the same as the one the service is running on?


@casperOne:我看到您的解决方案,这是一样的人(即使你)已经被张贴左右。就我而言,虽然,我相信我在一个安全的环境中运行,并且只有一个用户在同一时间内登录到一台机器。是不是有什么人能做到简单地取消隐藏图形用户界面?为什么会与用户系统,允许与桌面,而不是与其他用户互动这项工作?

@casperOne: I see your solution, and it is the same that people (even you) have been posting around. In my case though, I am sure I am running on a secure environment and ONLY one user will be logged into a machine at a time. Isn't there anything one can do to simply unhide the GUIs? Why would this work with the user SYSTEM allowing interaction with desktop and not with another user?

推荐答案

您的做法是完全错误的,在Vista上部署时,将无法正常工作。

Your approach is completely wrong, and will not work when deployed on Vista.

服务永远不应该承担与桌面进行交互登录会话。

Services should NEVER assume a login session with a desktop to interact with.

相反,您应具有当在用户登录(或在某个时间的其他点)与服务进行通信,然后显示UI元素,当它接收到来自服务通知/响应其上运行的第二应用

Rather, you should have a second application which is run when the user logs in (or some other point in time) which communicates with the service and then displays UI elements when it receives notifications/responses from the service.

更多信息请参见本的其他问题(和答案):

See this other question (and answers) for further information:

http://stackoverflow.com/questions/466199/how-to-detect-if-a-window-can-待显示

这篇关于从Windows服务与网络日志上创建GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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