创建系统托盘图标的后台进程 [英] Create a background process with system tray icon
问题描述
我试图做一个Windows应用程序,则在后台检查一些东西,并通过系统托盘图标通知用户。
I'm trying to make a Windows app that checks some things in the background, and inform the user via a systray icon.
该应用程序是由与不托管C ++并没有选项切换到.NET或Java。
The app is made with Not managed C++ and there is no option to switch to .net or Java.
如果用户想要停止的应用程序,他会用托盘图标。
If the user wants to stop the app, he will use the tray icon.
应用程序可以不会因为系统托盘端的服务因为它必须在没有在用户计算机上安装任何东西(这是一个单个.exe)运行
The app can't be a Service because of the systray side and because it must run without installing anything on the user computer ( it's a single .exe )
使用典型的Win32程序结构(的RegisterClass,的WndProc等)我不知道我怎么可以把一些code运行除了窗口消息循环。
也许我必须使用的CreateProcess()或的CreateThread()?它是处理多线程环境的正确方法是什么?
Using the typical Win32 program structure ( RegisterClass, WndProc and so on ) i dont know how can i place some code to run apart the window message loop. Maybe i have to use CreateProcess() or CreateThread()? Is It the correct way to handle the Multithreading environment?
如果我必须使用的CreateProcess()/的CreateThread(),我怎么能在两个线程之间comunicate?
If i have to use CreateProcess()/CreateThread(), how can i comunicate between the two threads?
感谢;)
推荐答案
至于系统托盘图标,你需要Shell_NotifyIcon。
As for the system tray icon, you'll need Shell_NotifyIcon.
请参阅 http://msdn.microsoft.com/en-us/library /bb762159.aspx
这篇关于创建系统托盘图标的后台进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!