用可可色覆盖带有窗口的屏幕

发布于 2024-09-28 13:16:12 字数 327 浏览 0 评论 0原文


我正在 Cocoa 中编写一个 Mac 应用程序,它需要能够“锁定”计算机。基本上,我正在编写一个小代理,它将坐在后台,当出现提示时,弹出一个覆盖整个屏幕(包括状态栏)的窗口,并显示一条消息(类似于“小偷,把我的电脑还给我!”) )。

该窗口有两个要求:它不能移动,也不能关闭、最小化或以其他方式禁用——只是屏幕上有一个大斑点,确保小偷无法使用计算机。我已经准备好了所有代理的东西,但我需要帮助编码这个窗口。有人有什么想法吗?

谢谢,
Chris

P.S - 在我的梦想世界中,这个窗口甚至会出现在登录屏幕上。代理将在那时运行,但我不确定 OS X 是否允许它......

I am writing a Mac application, in Cocoa, that needs the ability to 'lock down' the computer. Basically, I am writing a small agent that will sit in the background and when prompted, throw up a window that covers the entire screen, including the status bar, and shows a message (something like "give me back my computer, thief!").

The window has two requirements: it can't be moved and it can't be closed, minimized or otherwise disabled - just a big blob sitting on the screen, making sure the thief can't use the computer. I have all the agent stuff lined up, but I need help coding this window. Does anyone have any ideas?

Thanks,
Chris

P.S - In my dream world, this window would show up even at the login screen. The agent will be running by then, but I am not sure if OS X will allow it...

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

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

发布评论

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

评论(1

风吹雪碎 2024-10-05 13:16:12

您所要求的基本上是将用户的计算机变成功能不太强大的 信息亭。另请参阅有关同一主题的此技术说明

对于显示,Kiosk 模式文档中描述的全屏视图模式的替代方案包括:

  • 捕获所有显示并使用 Quartz Display Services 直接绘制到它们。
  • 将窗口的框架设置为屏幕的框架,并将其窗口级别设置得非常高。您需要为每个屏幕创建一个这样的窗口。

What you're asking for is basically to turn the user's computer into a not-very-functional kiosk. See also this technote on the same subject.

For display, alternatives to the full-screen view mode described in the Kiosk Mode document include:

  • Capture all the displays and draw directly to them using Quartz Display Services.
  • Set your window's frame to the frame of its screen and set its window level really high. You'll need to create one such window per screen.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文