NotifyIcon - 总是显示图标? [英] NotifyIcon - always show icon?

查看:127
本文介绍了NotifyIcon - 总是显示图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个正在处理的应用程序,它在后台运行,我在系统托盘中有一个NotifyIcon,我用它来通知用户一些事情。但现在我遇到了一个小问题。



我希望能够始终在系统图标旁边显示图标,即动作中心,网络,声音。并没有隐藏其他应用程序,你必须单击向上箭头显示它们。



如果你不确定我的意思,控制面板下有这个东西通知区域图标,允许您更改每个图标可以执行的操作,即显示图标和通知,隐藏图标和通知和仅显示通知< - 这是一个Windows 7示例,我不知道如何它将在XP或Vista中。但这基本上就是我想要做的。我想以编程方式将我的应用程序设置为显示图标和通知。



我知道它是可能的!我已经看到它在行动了。一个名为DropBox的程序 - 一旦安装它就会自动出现在时钟旁边,它的图标总是显示出来。



这是我想要它的图像示例: (箭头显示我的申请表)



http://i719.photobucket.com/albums/ww199/Pk_King_X11/NotifyIconExample.png



- -------------------------------------------------- --------------



编辑:请转到:控制面板\所有控制面板项目\通知区域图标 (Windows 7)



^你会看到每个图标都有一个行为,我想以编程方式设置我的'显示图标和通知'。我知道有可能...... DropBox已经完成了。



编辑2:



好​​的,现在我看看它是如何工作的。像DropBox和一些Anti-Viruses这样的程序基本上改变了它们在托盘中的图标位置......通过将它更改为0或1(这是第一个),基本上将它们放在时钟旁边,从而自动更改通知区域图标设置到'显示图标和通知',现在这是纯粹的天才...



但接下来是一个问题。我怎么能实现这个目的?

Hello, I have an app I'm working on that runs in the background and I have a NotifyIcon in the system tray, which I use to notify the user of some things. But now I came to a little problem.

I want to be able to always show the icon next to the system icons, i.e. Action centre, network, sound. And not hidden with other apps whereby you have to click the up arrow to show them.

If your not sure what I mean, there is this thing in control panel under Notification Area Icons which allows you to change what each icon can do, i.e. 'Show icon and notification', 'Hide icon and notifications' and 'Only show notification' <-- that's a Windows 7 example, I don't know how it would be in XP or Vista. But that is basically what I want to do. I want to programmatically set my application to 'Show icons and notifications'.

I know it's possible! I've seen it in action. A program named DropBox - once installed it automatically appears next to the clock and it's icon is always shown.

Here is an image example of how I want it to be: (The arrow shows my application)

http://i719.photobucket.com/albums/ww199/Pk_King_X11/NotifyIconExample.png

------------------------------------------------------------------

Please goto: "Control Panel\All Control Panel Items\Notification Area Icons" (Windows 7)

^ You will see each icon has a behaviour, I want to set mine to 'Show icon and notifications' programmatically. I know it is possible... DropBox has done it.

EDIT 2:

OK, now I see how it works. Programs like DropBox and some Anti-Viruses basically change their icon's position in the tray... By changing it to 0 or 1 which ever is the first one, basically puts them right next to the clock, thus automatically changing the Notification Area Icons settings to 'Show icon and notifications', now that's pure genius...

But then comes a question. How could I achieve this?

推荐答案

你在应用程序中无法控制它。它完全基于谁先到达那里,获胜的基础。
You don't have control over this in your app. It's based entirely on a "whoever gets there first, wins" basis.


没有API [ ^ ]对不起,抱歉。 Windows是故意这样设计的。



但是,我想将选项存储在注册表中的某个地方,所以你可能想在那里挖掘。
There is no API[^] for it, sorry. Windows was designed this way on purpose.

However, I image the options are stored somewhere in the registry, so you may want to dig around there.


根据Microsoft,这是不可能的。



According to Microsoft, it is not possible to do this.

Quote:

应用程序无法在首次安装时或在运行时的任何时间以编程方式始终在系统托盘上显示自己的顶级。这是我们在Windows 7中进行的一些变化之一,旨在生成更清晰,更安静的桌面,用户可以通过自己喜欢的应用程序和图标自定义顶级桌面。

There is no way for applications to programmatically always show themselves top level on the system tray either on first install or at any time during runtime. This is one of several changes we’ve made in Windows 7 in an effort to produce a cleaner, quieter desktop that is in the user’s control to customize the top level with their favorite applications and icons.





需要注意的一点是,Windows似乎记得您在卸载应用程序时选择的设置,然后重新安装它。这可能是发生了什么吗?



当我在我的Win8桌面和我的Win7笔记本电脑上安装DropBox时,图标被隐藏,直到我手动进入并设置它显示图标和通知。





如果Windows在DropBox(或任何应用程序)中检测到此图标,那将是非常好的首先安装了一个图标,并提示用户始终隐藏,或显示通知或始终显示。这可能与他们努力生产更干净,更快速的桌面相违背,所以它可能不会发生。



One thing to note is that Windows seems to remember the settings you choose when you uninstall an application, and then reinstall it. Is it possible that this is what happened?

When I installed DropBox on my Win8 desktop and my Win7 laptop, the icon was hidden until I manually went in and set it to "Show icon and notifications".


What would be really nice is if Windows detected this icon when DropBox (or any app that has an icon) was first installed, and prompted the user to Always hide, or Show Notifications, or Always Show. That would probably go against their "effort to produce a cleaner, quiter desktop" though, so it probably wouldn't happen.


这篇关于NotifyIcon - 总是显示图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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