久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何顯示來自 Windows 服務的通知區域氣球和圖標

How can I show a Notification Area Balloon and Icon from a Windows Service?(如何顯示來自 Windows 服務的通知區域氣球和圖標?)
本文介紹了如何顯示來自 Windows 服務的通知區域氣球和圖標?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 Windows 服務,當用戶啟動他們的工作站時它總是在運行.此 Windows 服務很關鍵,我想在發生某些事情(例如服務停止、啟動、重新啟動等)時在通知區域顯示氣球通知.

I have a Windows Service that is always running when the user starts their workstation. This Windows Service is critical and I would like to show a Balloon Notification in the Notification Area when certain things happen such as the Service Stops, Starts, Restarts etc.

例如:

另外,有沒有辦法為我的 Windows 服務顯示通知區域圖標?

Also, is there a way to show a Notification Area Icon for my Windows Service?

推薦答案

Windows 服務直接與桌面交互的時代已經結束,因此您必須尋找另一種方式.

The days of Windows services interacting directly with the desktop are over, so you have to find another way.

我所做的是創建一個包含 NotifyIcon 的普通 WinForms 應用程序.此應用程序的行為模仿任務管理器的行為,因此它可以從任務欄中隱藏,并且只能在系統托盤中可見.如果我右鍵單擊系統托盤圖標,我會看到一個菜單.如果我雙擊該圖標,則會顯示應用程序窗口.

What I have done is create a normal WinForms application that includes a NotifyIcon. The behavior of this application mimics that of Task Manager, such that it can be hidden from the task bar and only visible in the system tray. If I right-click the system tray icon, I get a menu. If I double-click the icon, the application window is shown.

為了方便WinForms應用程序和Windows服務之間的通信,我使用了WCF.具體來說,我使用 Juval Lowy 的 發布訂閱框架,它非常適合這種場景.查看我的回答此處了解更多信息詳情.

To facilitate the communication between the WinForms application and the Windows service, I use WCF. Specifically, I use Juval Lowy's Publish-Subscribe Framework, which works really well for this kind of scenario. See my answer here for more details.

希望這會有所幫助.

這篇關于如何顯示來自 Windows 服務的通知區域氣球和圖標?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發問題)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調用 Parameters.Clear 嗎?)
what does a using statement without variable do when disposing?(處理時不帶變量的 using 語句有什么作用?)
Why doesn#39;t TransactionScope work with Entity Framework?(為什么 TransactionScope 不適用于實體框架?)
How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中處理 TransactionScope?)
主站蜘蛛池模板: 特级淫片裸体免费看 | 五月婷婷亚洲 | 欧美日韩精品一区二区在线播放 | 亚洲精品小视频 | 日韩中文字幕第一页 | 成人国产精品一区二区 | 日韩精品在线免费观看 | 久久在线视频 | 18在线观看免费入口 | 久久精品6 | 男女啪啪网站 | 日本在线观看一区 | 在线视频日韩 | 在线观看小视频 | 日韩在线不卡视频 | 一级做a爱片性色毛片 | 伊人综合影院 | 午夜免费看片 | 亚洲第一av | 欧美精品二区 | 国产精品久久久久久久 | 日韩免费一级片 | 日韩有码在线视频 | 神马午夜嘿嘿 | 欧美在线视频观看 | 男女无遮挡xx00动态图120秒 | 久久久精品一区 | 午夜影院在线观看视频 | 国产精品自拍一区 | 亚洲欧美综合网 | 色综合欧美 | 久久成人国产 | 97免费在线 | 黄色三级视频网站 | 国产精品久久久久久久免费看 | 在线播放成人 | 国产成人精品视频 | 国产精品久久久久久久久久久久久久 | 日韩福利视频 | 日韩成人在线观看视频 | 免费毛片视频 |