如何在Windows服务中放置通知图标消息 [英] How to Put Notify Icon Message in Windows Service

查看:176
本文介绍了如何在Windows服务中放置通知图标消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,


在这里,我想将通知图标"消息放入我的Windows服务"中.但是我尽了最大努力,但是当"Windows服务"为状态"时,通知图标"消息未触发.如果有任何相关信息,请与我分享.



问候,

AnilKumar.D

Dear Friends,


Here i want to put Notify Icon Message in My Windows Service.But i tried as my best But the Notify Icon Message is not Fired when Windows Service as Stated.if any information related this please share with me.



Regards,

AnilKumar.D

推荐答案

在Windows XP中有效.在Vista和7中,您不能直接与桌面进行交互,因为桌面进程在会话0中运行,而服务进程在会话1中运行.如果要触发通知图标,则必须在启动de Service like时绕过UAC,该操作说明如下
That works in Windows XP. In Vista and 7 you cannot interact with the desktop directly because desktop process run in session 0 and services process in session 1. If you want to fire a notify icon you have to bypasss UAC when you start de Service like is explained here


服务中有一个复选框选项:

[]允许服务与桌面交互.

如果您确实希望服务过程显示图标,则必须选中此框.

通常,我注意到应用程序通常不会这样做.
他们将有一个使用loacalservice凭据在后台运行的服务,以及另一个使用当前用户凭据在桌面运行的应用程序.
使用可以在计算机上安装的各种帐户,这更容易处理.
There is a a check box option in the service:

[ ] Allow service to interact with desktop.

If you really want the service process to show the icon this box will have to be checked.

Typically I noticed that application generally don''t do that though.
They will have a service that run in the background using for example a loacalservice credentials and another app that run in the desktop using the current user credentials.
This is easier to handle with the various accounts that can be installed on the machine.


这篇关于如何在Windows服务中放置通知图标消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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