有没有办法使用 OSX cocoa NSApplication 方法 activateIgnoringOtherApps: 来激活已经加载的应用程序

发布于 2024-08-10 21:19:49 字数 248 浏览 13 评论 0原文

这可能是一个愚蠢的问题,但看起来 activateIgnoringOtherApps: 可能是使用 Cocoa 激活应用程序的唯一方法。我有一个加载 Cocoa 应用程序的 java 应用程序,我希望在发生这种情况时激活 Cocoa 应用程序。问题是我不想启动中间应用程序(某种控制器)并使用此应用程序来激活IgnoringOtherApps:我的其他Cocoa应用程序。有没有办法使用 activateIgnoringOtherApps: 强制我的 Cocoa 应用程序变得活跃?

This may be a dumb question but it seems like activateIgnoringOtherApps: may be the only way to activate an app using Cocoa. I have a java app that loads up a Cocoa app and I want the Cocoa app to be activated when this happens. The problem is I do not want to have to launch an intermediate app (some sort of controller) and use this app to activateIgnoringOtherApps: my other Cocoa app. Is there some way to use activateIgnoringOtherApps: to force my Cocoa app to become active?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

几味少女 2024-08-17 21:19:49

我认为你不明白它是如何工作的。这是一个将从应用程序内部调用的方法,使其成为活动应用程序。您无法将此消息发送到另一个未运行的应用程序以使其启动。

I think you're not understanding how it works. This is a method that would be called from within the application to make it become the active application. You can't send this message to another application that isn't running to make it start.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文