【问题标题】:How to create an inaccessible window on Mac OS?如何在 Mac OS 上创建无法访问的窗口?
【发布时间】:2010-06-24 17:00:23
【问题描述】:

我的意思是一个无法通过 Cocoa、Carbon 或其他 CoreGraphics API 访问以获取 NSWindow *、WindowRef 等的窗口。

Like X11 application on Mac does.

这样一个窗口,如果你将它的窗口 ID 传递给 [NSApp windowWithWindowID] 或 HIWindowFromCGWindowID() 它们都返回 NULL。

谢谢!

【问题讨论】:

  • 也许,有人熟悉 libXplugin.dylib 和 Xplugin.h 吗?它在其函数 xp_create_window() 中使用了未记录的 CoreGraphics API CGSNewWindow() 等。
  • 因为我需要获取 X11 模拟窗口的图形端口,但它没有响应来自同一进程的 [NSApp windowWithWindowNumber: ] 或 HIWindowFromCGWindowID()。我很好奇它是如何以这种方式创建窗口的?

标签: cocoa macos core-graphics x11 macos-carbon


【解决方案1】:

有 CoreGraphics 私有 API。由于逆向工程,它的定义is available。如果某些窗口是使用此类 API 创建的,则无法通过 [NSApp windowWithWindowNumber: (NSInteger)windowID] 或 HIWindowFromCGWindowID() 函数访问它。

Xquartz 使用 Xplugin 库,而后者又使用 CoreGraphics Private API。

【讨论】:

  • shoumikhin,你能用它吗?它解决了你的问题吗? - 我处于同样的情况,想知道这是否是解决问题的途径。
猜你喜欢
  • 2020-10-22
  • 2012-05-24
  • 1970-01-01
  • 1970-01-01
  • 2014-07-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多