最近打开的应用程序

编程入门 行业动态 更新时间:2024-10-13 06:19:25
本文介绍了最近打开的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有办法得到最近打开的应用程序的列表,比如说4?如果是,如何?

(Cocoa Mac)

解决方案

请查看 LaunchServices / LSSharedFileList.h 头文件。不幸的是,这个文件中的函数没有记录在Xcode文档中,但文件中的注释是非常好的。基本上,通过将 kLSSharedFileListRecentApplicationItems 传递给 LSSharedFileListCreate(),可以创建对最近打开的应用程序列表的引用。然后使用 LSSharedFileListCopySnapshot()获取列表当前内容的数组。

Is there any way of getting a list of, say 4, recently opened Applications? If so, how?

(Cocoa Mac)

解决方案

Have a look at the LaunchServices/LSSharedFileList.h header file. Unfortunately, the functions in this file are not documented in the Xcode docs, but the comments in the file are very good. Basically, you create a reference to the list of recently opened applications by passing kLSSharedFileListRecentApplicationItems to LSSharedFileListCreate(). Then get an array of the current contents of the list with LSSharedFileListCopySnapshot().

更多推荐

最近打开的应用程序

本文发布于:2023-11-27 10:50:03,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!