系统托盘应用程序 [英] System Tray Application

查看:69
本文介绍了系统托盘应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿那里,

我有一个正在运行的系统托盘应用程序,它需要

与我写的Windows服务进行通信。我的问题是,如果

a用户切换到另一个桌面,我需要该服务才能区分数据需要发送给应用程序

A而不是app B.我打算尝试使用桌面手柄来区分两者,但我不能创建服务作为

互动服务(我也不想,因为它是一个安全性的b $ b缺陷,而且Windows明确禁止在Vista中使用它)。那么,

如果我有需要发送到一个系统托盘应用程序的数据,我该如何区分两者?


谢谢!

Jay

(gmail dot com上的patelj27b)

解决方案

"周杰伦" < pa ******* @ gmail.comwrote in message

news:11 ********************** @ m7g2000cwm.googlegro ups.com ...


我有一个正在运行的系统托盘应用程序,它需要

与我写的Windows服务。我的问题是,如果

a用户切换到另一个桌面,我需要该服务才能区分数据需要发送给应用程序

A而不是app B.我打算尝试使用桌面手柄来区分两者,但我不能创建服务作为

互动服务(我也不想,因为它是一个安全性的b $ b缺陷,而且Windows明确禁止在Vista中使用它)。那么,

如果我有需要发送到一个系统托盘应用程序的数据,我怎么能区分两者?



我不知道问题是什么。难道你没有服务公开套接字

或其客户端的命名管道接口?您可以使用您需要的任何识别信息标记您通过套接字或管道发送的消息。


问候,





William DePalo [MVP VC ++]写道:


"周杰伦" < pa ******* @ gmail.comwrote in message

news:11 ********************** @ m7g2000cwm.googlegro ups.com ...


我有一个正在运行的系统托盘应用程序,它需要

与我写的Windows服务。我的问题是,如果

a用户切换到另一个桌面,我需要该服务才能区分数据需要发送给应用程序

A而不是app B.我打算尝试使用桌面手柄来区分两者,但我不能创建服务作为

互动服务(我也不想,因为它是一个安全性的b $ b缺陷,而且Windows明确禁止在Vista中使用它)。那么,

如果我有需要发送到一个系统托盘应用程序的数据,我怎么能区分两者?



我不知道问题是什么。难道你没有服务公开套接字

或其客户端的命名管道接口?您可以使用您需要的任何识别信息标记您通过套接字或管道发送的消息。


问候,




如果服务需要通过系统进行一些桌面交互

托盘应用程序,那么它需要知道哪一个要做上。

发送消息没有关于哪个系统发送给它的托盘应用程序的信息。结合信息将保留在定制结构中。


谢谢!

Jay

(在gmail dot com上的patelj27b


" Jay" < pa ******* @ gmail.comwrote in message

news:11 ********************** @ m73g2000cwd.googlegr oups.com ...


如果服务需要通过系统进行一些桌面交互

托盘应用程序,那么它需要知道在哪一个上做。



服务不应与桌面交互。这就是问题所在。 AFAIK,

Vista将不再支持互动服务。 IMO,现在是改变你的设计的好时机。


问候,



Hey There,
I have a system tray application that is running, and it needs to
communicate with a Windows Service that I wrote. My problem is that if
a user switches to another desktop, I need the service to have
communication be able to distinguish that data needs to be sent to app
A instead of app B. I was going to try to use a desktop handle to
distinguish between the two, but I can''t create the service as an
interactive service (nor would I want to, with it being a security
flaw, and also with Windows explicitly not allowing it in Vista). So,
if I have data that needs to be sent to one system tray app, how can I
differentiate between the two?

Thanks!
Jay
(patelj27b at gmail dot com)

解决方案

"Jay" <pa*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...

I have a system tray application that is running, and it needs to
communicate with a Windows Service that I wrote. My problem is that if
a user switches to another desktop, I need the service to have
communication be able to distinguish that data needs to be sent to app
A instead of app B. I was going to try to use a desktop handle to
distinguish between the two, but I can''t create the service as an
interactive service (nor would I want to, with it being a security
flaw, and also with Windows explicitly not allowing it in Vista). So,
if I have data that needs to be sent to one system tray app, how can I
differentiate between the two?

I''m not sure what the problem is. Can''t you have the service expose a socket
or a named-pipe interface to its clients? You can tag the messages that you
send over the socket or pipe with whatever identifying information you need.

Regards,
Will



William DePalo [MVP VC++] wrote:

"Jay" <pa*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...

I have a system tray application that is running, and it needs to
communicate with a Windows Service that I wrote. My problem is that if
a user switches to another desktop, I need the service to have
communication be able to distinguish that data needs to be sent to app
A instead of app B. I was going to try to use a desktop handle to
distinguish between the two, but I can''t create the service as an
interactive service (nor would I want to, with it being a security
flaw, and also with Windows explicitly not allowing it in Vista). So,
if I have data that needs to be sent to one system tray app, how can I
differentiate between the two?


I''m not sure what the problem is. Can''t you have the service expose a socket
or a named-pipe interface to its clients? You can tag the messages that you
send over the socket or pipe with whatever identifying information you need.

Regards,
Will

If the service needs to do some desktop interaction through the system
tray application, then it needs to know which one to do it on. the
originating message doesn''t have information regarding which system
tray application to send it to. That conjunction information will be
kept in custom structures.

Thanks!
Jay
(patelj27b at gmail dot com)


"Jay" <pa*******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...

If the service needs to do some desktop interaction through the system
tray application, then it needs to know which one to do it on.

Services should not interact with the desktop. That''s the issue. AFAIK,
Vista will no longer support interactive services. IMO, now is a good time
to change your design.

Regards,
Will


这篇关于系统托盘应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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