
大家知道Acrobat AIR程序切换到Widget模式下,最小化时有个收缩并移动到系统托盘区的过渡动画效果,即使将任务栏更改到屏幕的其他区域,程序均能正确的收缩到新的系统托盘位置.
对这个效果很感兴趣,于是从文档及网络查了相关的API,包括DockIcon,SystemTrayIcon,无果.
最后在想是不是Adobe开发人员使用了未开放的屏幕类,呵呵,想到屏幕类忽然来了灵感,虽然最开始时Screen类也排查过,并无提供系统托盘相关方法,但仔细观察她的方法和属性:
[color=Blue]bounds : Rectangle
[color=Black][read-only] The bounds of this Screen.
[color=Blue]mainScreen : Screen
[color=Black][static] [read-only] The primary display.
[color=Blue]visibleBounds : Rectangle
[color=Black][read-only] The bounds of the area on this Screen in which windows will be visible.
通过mainScreen.bounds和visibleBounds的比较得出当前任务栏的位置.
trace得到:
[color=Brown](x=0, y=0, w=1400, h=1050)
(x=0, y=0, w=1400, h=1020)
得出我的任务栏位置是bottom,任务栏高度是30像素.Y坐标没问题了,那么X坐标呢?
观察得知,Acrobat AIR程序并未获得精确的X坐标.通过增加或减少托盘区的图标,可以发现每次收缩结束时的X坐标位置未有任何变化.那么暂时可以使用固定值来代替.
接下来就是代码的工作了 ![]()
[b]AIR Setup File
Source Code[/b]
测试的操作系统:Windows XP Pro. SP2
如果DEMO程序有BUG或你有更好的方法甚至知道如何获得系统托盘精确位置,务必留言或写信联系我.
auzn1982[AT]gmail.com
Cheers!

I agree; They are recognized to work on our body such a good way that it is only the poor cholesterol which takes removed from your body with out any kind of impact on good cholesterol or maybe Hdl cholesterol.
[Reply]
It constantly is amazing to me exactly how Bloggers for example your self can find enough time and also the commitment to keep on Producing great discussions your blog is excellent and one of my personal need to read blogs, I’d been more than impressed with the blog post I simply wanted to thank you and congratulations
[Reply]
还是不能很准吧
[reply=auzn,2009-04-22 01:49 PM]对,就写文章时的AIR来说,X坐标没法获得精确数值。AIR 1.51不知道是否可以,呵呵[/reply]
[Reply]
@Kenshin:
呵呵,你说情况也有可能发生.
前几天的Beta2就加了几个新特性,只加不改还是不错的呀
[Reply]
@auzn
项目太紧张,没办法。都没时间去研究Flash player 10的API:)
不过希望他不要想Flex beta版本那样,和release版本很了一些:(
[Reply]
@Y.Boy:
[lol] 谢谢Y.Boy的支持
[Reply]
Good!
学到东西了!
我也留言支持!
[Reply]
@liwm:
[eek]瞎说,你不是也做过FLEX相关的项目吗?我记得你提到过.
[Reply]
太有才了,虽然我看不懂
[Reply]
@Kenshin:
呵呵,最近没看你BLOG更新呀
@mousebomb:
谢谢支持呀
[Reply]
多谢分享,学习了
[Reply]
不错,值得借鉴:)
[Reply]