问题描述
嘿那里,
我有一个正在运行的系统托盘应用程序,它需要
与我写的Windows服务进行通信。我的问题是,如果
a用户切换到另一个桌面,我需要该服务才能区分数据需要发送给应用程序
A而不是app B.我打算尝试使用桌面手柄来区分两者,但我不能创建服务作为
互动服务(我也不想,因为它是一个安全性的b $ b缺陷,而且Windows明确禁止在Vista中使用它)。那么,
如果我有需要发送到一个系统托盘应用程序的数据,我该如何区分两者?
谢谢!
Jay
(gmail dot com上的patelj27b)
我不知道问题是什么。难道你没有服务公开套接字
或其客户端的命名管道接口?您可以使用您需要的任何识别信息标记您通过套接字或管道发送的消息。
问候,
将
我不知道问题是什么。难道你没有服务公开套接字
或其客户端的命名管道接口?您可以使用您需要的任何识别信息标记您通过套接字或管道发送的消息。
问候,
将
如果服务需要通过系统进行一些桌面交互
托盘应用程序,那么它需要知道哪一个要做上。
发送消息没有关于哪个系统发送给它的托盘应用程序的信息。结合信息将保留在定制结构中。
谢谢!
Jay
(在gmail dot com上的patelj27b
服务不应与桌面交互。这就是问题所在。 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)
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
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)
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
这篇关于系统托盘应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!