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

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

问题描述

我(在 Delphi 中)编写了一些旧应用程序,它们出于各种原因使用系统托盘图标.大多数都在使用 AppControls TacTrayIcon 或其他类似的组件.

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.

这是我的问题:如何控制托盘图标的位置?(即相对于系统时间的位置——第一个位置/插槽"、第二个位置/插槽"等).我记得看过一个演示(C#,如果没记错的话),它允许用户向左移动图标"和向右移动图标",但不记得它是如何完成的.

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.

对于 Windows 2000 - Windows 7,我希望允许用户选择他们希望图标出现的位置.(我了解 Windows 7 处理系统托盘内容的方式略有不同,但尚未对此进行测试但是).

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).

感谢所有帮助.

推荐答案

程序没有记录或支持的方式来控制其外壳通知图标的位置.甚至没有任何东西可以保证它们会出现,或者如果它们确实出现了,它们会出现在时钟附近的任何地方,这样你的定位指令就会有意义.

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.

(我曾经使用一个程序劫持了部分或全部图标,并有选择地将它们显示在自己的窗口中,而不是在时钟附近的区域中.它是 TraySaver,作者 Mike Lin.如果你想看看他的 hack 是如何工作的,可以使用源代码.)

(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天全站免登陆