将vc ++控制台窗口放入系统托盘 [英] Place vc++ console window in system tray

查看:210
本文介绍了将vc ++控制台窗口放入系统托盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的VC ++程序,当我将窗口最小化时,我想将输出控制台窗口放在系统托盘中而不是在任务栏中.
我是vc ++的新手,请帮助我,该怎么办.

I have small VC++ program, I want to place my output console window in the system tray not in the task bar when I have minimize the window.
I am new in vc++ please help me, how could I do this.

推荐答案

基本上,您需要使用Shell_NotifyIcon:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/bb762159%28v=vs.85%29.aspx [ http:///www.codeguru.com/cpp/controls/statusbar/systemtray/article.php/c5933/Tutorial--Write-Icon-in-the-Taskbar-Window.htm [
如果您只需要在方便的可预测位置访问您的或其他重要应用程序,则可能需要制作一个简单的系统实用程序,其行为类似于典型的通知图标"应用程序,但可用于方便地激活其他应用程序,其中一些它们可能只是控制台应用程序.您可以设计一种将客户端应用程序注册到实用程序主机"应用程序的机制,这样,当用户将客户端应用程序最小化时,您的客户端应用程序可能会被完全隐藏,但是在实用程序屏幕中显示为可点击区域,因此单击可以激活您的客户端应用程序.

我不会说这样做会很方便.您仍然会认为,可以按照我刚才描述的路线图成功实现它.

祝你好运,
—SA
Basically, you need to use Shell_NotifyIcon:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762159%28v=vs.85%29.aspx[^].

This is some tutorial:
http://www.codeguru.com/cpp/controls/statusbar/systemtray/article.php/c5933/Tutorial--Write-Icon-in-the-Taskbar-Window.htm[^].

However, this is a bad place for a console application, in my opinion. The main use of this Shell feature is to provide a tiny UI, or even two views of such UI: one cold provide a visual notification in the area dedicated to "shell notify" application, and the click on it could show a bigger but still small window immediately next to the "notify icon" area, with some UI control. As you can see, this behavior is largely oriented to the windowed applications.

If you simply need the access to your or some other important applications in some convenient predictable location, perhaps you should need to make a simple system utility which behaves like a typical "notify icon" application but is used to conveniently activate other applications, some of them could be just console applications. You can devise some mechanism of registration of client applications with your utility "host" application, so your client application could be completely hidden when a user minimizes them, but represented as a clickable area in your utility screen, so the click could activate your client applications.

I would not say this would be so convenient to justify the effort. It you still think it would, you can successfully achieve it following the road map I just depicted.

Good luck,
—SA


这篇关于将vc ++控制台窗口放入系统托盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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