Windows系统托盘图标 - 控制位置 [英] Windows System Tray icons - controlling position

查看:141
本文介绍了Windows系统托盘图标 - 控制位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个我写的旧应用程序(在Delphi中),由于各种原因使用系统托盘图标。大多数人都在使用AppControls TacTrayIcon或其他类似的组件。



这是我的问题:如何控制托盘图标的位置? (即,相对于系统时间 - 第一位置/时隙,第二位置/时隙等)。我记得看到演示(C#,如果内存服务),允许用户向左移动图标和向右移动图标,但不记得如何完成。



我想允许用户选择他们想要的图标出现的位置,对于Windows 2000 - Windows 7.(我了解Windows 7处理系统托盘有一点不同,但还没有测试出来)。



感谢任何和所有的帮助。

解决方案

程序无法记录或支持的方式来控制其通知图标的位置。甚至没有什么保证他们会出现,或者如果它们出现,他们会出现在任何地方,所以你的定位说明会有任何意义。



TraySaver ,由Mike Lin提供,如果您希望看到他的黑客是如何工作的,则可以使用该来源。)



图标的位置不在你的控制之下。我对你的建议是不要试图使你的程序的责任,特别是如果没有人真的从你的程序请求这样的功能,首先。如果人们想要控制你的程序的图标位置,他们可能想要控制其他程序的图标位置,在这种情况下问题比你更大。


I have a few old apps I've written (in Delphi) which for various reasons use a system tray icon. Most are using AppControls TacTrayIcon or some other similar component.

Here's my question: How does one control the position of a tray icon? (i.e. where it is, say, relative to the system time -- 1st position/"slot", 2nd position/"slot", etc). I recall seeing a demo (C#, if memory serves) that allowed the user to "shift icon to the left" and "shift icon to the right", but don't recall how it was done.

I'd like to allow the user to select what position they want to icon to appear in, for Windows 2000 - Windows 7. (I understand Windows 7 handles system tray stuff a little differently, but haven't tested that out yet).

Thanks for any and all help.

解决方案

There is no documented or supported way for programs to control the positions of their shell notification icons. There's not even anything guaranteeing they will appear at all, or if they do appear, that they will appear anywhere near the clock, such that your positioning instructions would make any sense.

(I used to use a program that hijacked some or all of the icons and optionally displayed them in its own window instead of in the area near the clock. It was TraySaver, by Mike Lin. The source is available if you wish to see how his hack worked.)

The icon's position is not under your control. My advice to you is to not try to make it your program's responsibility, especially if nobody has actually requested such functionality from your program in the first place. If people want to control your program's icon location, they probably want to control other programs' icon locations, in which case the problem is bigger than you anyway.

这篇关于Windows系统托盘图标 - 控制位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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