获取桌面图标的位置?
有没有办法获取 Snow Leopard 中桌面图标的位置?我相信 Leopard 中的每个图标都是不同的窗口,但这种情况在 SL 中发生了变化。
是否有 API 可以执行此操作或有文件(如配置文件)可以解析?
Is there a way to get the locations of the desktop icons in Snow Leopard? I believe each icon was a different window in Leopard, but this changed with SL.
Is there an API to do this or a file (like a configuration file) to parse?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,桌面上的图标似乎是“AXImage”。如果您退出辅助功能检查器(在/Applications/Utilities/辅助功能工具/中),您可以检查屏幕上项目报告的辅助功能信息。
例如:
Accessibility API(无论如何,较低级别的 API)是 HIServices 的一部分:
/System/Library/Frameworks/ApplicationServices.framework
/.../HIServices.framework(您链接 ApplicationServices 伞形框架并将其导入到您的然而,项目)。
我对这些 API 不太熟悉,因此无法提供具体信息,但这将是一个起点。
希望这有帮助...
As far as I can tell, icons on the Desktop appear to be an "AXImage". If you get out Accessibility Inspector (in /Applications/Utilities/Accessibility Tools/), you can examine the Accessibility information reported for items on the screen.
For example:
The Accessibility APIs (the lower level ones, anyway), are part of HIServices:
/System/Library/Frameworks/ApplicationServices.framework/.../HIServices.framework
(You link against and import the ApplicationServices umbrella framework into your project, however).
I'm not that familiar with those APIs so I can't offer specifics, but that would be a place to start.
Hope this helps...
文件和文件夹图标的位置位于 .DS_Store 文件中,该文件存在于任何目录(Finder 已查看过的)
http://en.wikipedia.org/wiki/.DS_Store
https://wiki .mozilla.org/DS_Store_File_Format
Position of files and folders icons is in the .DS_Store file, this exists for any directory (that Finder has viewed)
http://en.wikipedia.org/wiki/.DS_Store
https://wiki.mozilla.org/DS_Store_File_Format