Macos Delphi Macapi.CoreServices缺少LaunchServices
我试图使用lscopyallhandlersforlscheme函数枚举Mac OS X下已安装的web浏览器,以我的方式,我检查了Delphi RTL中包含的Macapi.CoreServices文件,发现并非所有包含文件都存在,它们看起来像注释,而不是$I include指令,我错过什么了吗?这是密码Macos Delphi Macapi.CoreServices缺少LaunchServices,macos,delphi,launch-services,Macos,Delphi,Launch Services,我试图使用lscopyallhandlersforlscheme函数枚举Mac OS X下已安装的web浏览器,以我的方式,我检查了Delphi RTL中包含的Macapi.CoreServices文件,发现并非所有包含文件都存在,它们看起来像注释,而不是$I include指令,我错过什么了吗?这是密码 unit Macapi.CoreServices; {$WEAKPACKAGEUNIT} interface {$I OSTypes.inc} {$I MacTypes.inc} {$I
unit Macapi.CoreServices;
{$WEAKPACKAGEUNIT}
interface
{$I OSTypes.inc}
{$I MacTypes.inc}
{$I TextCommon.inc}
{$I Files.inc}
{$I DispatchSemaphores.inc}
{$I MacErrors.inc}
{$IFNDEF IOS}
{$I Multiprocessing.inc}
{$I DriverServices.inc}
{$I Gestalt.inc}
{$ENDIF !IOS}
{ $I OSServices.inc}
{ $I SFNetwork.inc}
{ $I LaunchServices.inc}
{ $I SearchKit.inc}
{ $I Metadata.inc}
{ $I DictionaryServices.inc}
{ $I AE.inc}
const
CoreServicesLib = '/System/Library/Frameworks/CoreServices.framework/CoreServices';
{$EXTERNALSYM CoreServicesLib}
CarbonCoreLib = '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/CarbonCore';
{$EXTERNALSYM CarbonCoreLib}
implementation
{$IF NOT DECLARED(_PU)}
const
{$IFDEF UNDERSCOREIMPORTNAME}
_PU = '_';
{$ELSE}
_PU = '';
{$ENDIF}
{$ENDIF}
{$I MacTypesImpl.inc}
{ $I TextCommonImpl.inc}
{$I FilesImpl.inc}
{$I DispatchSemaphoresImpl.inc}
{$IFNDEF IOS}
{$I MultiprocessingImpl.inc}
{$I DriverServicesImpl.inc}
{$I GestaltImpl.inc}
{$ENDIF !IOS}
{ $I OSServicesImpl.inc}
{ $I SFNetworkImpl.inc}
{ $I LaunchServicesImpl.inc}
{ $I SearchKitImpl.inc}
{ $I MetadataImpl.inc}
{ $I DictionaryServicesImpl.inc}
{ $I AEImpl.inc}
end.
现在我自己导入了这个函数,下面是如何实现它(非常简单): 我不知道为什么Embarcadero没有实施启动服务 谢谢
const launchServicesLib = '/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/LaunchServices';
function LSCopyAllHandlersForURLScheme(inURLScheme: CFStringRef) : CFArrayRef; cdecl; external launchServicesLib name '_LSCopyAllHandlersForURLScheme';