有没有办法得到最近打开的应用程序的列表,比如说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().
更多推荐
最近打开的应用程序
发布评论