简体   繁体   English

Mac OS X自定义Dock应用程序

[英]Mac OS X Custom Dock Application

I would like to know how to create a custom dock application in Mac OS X like Dockshelf or uBar: 我想知道如何在Mac OS X中创建Dockshelf或uBar之类的自定义停靠应用程序:

http://www.thealchemistguild.com/dockshelf/ http://www.thealchemistguild.com/dockshelf/

https://brawersoftware.com/products/ubar https://brawersoftware.com/products/ubar

Very importantly, this custom Dock should be visible when other applications go full screen (like the native OS X Dock). 非常重要的是,当其他应用程序全屏显示时(例如本机OS X Dock),该自定义Dock应该可见。

I cannot find this information anywhere. 我在任何地方都找不到此信息。 Thanks. 谢谢。

For the dock effect, create a very thin (say for example 2px wide), fully-transparent window with no decorations as your application's main window and fix it to the edge of the desktop (you need to take special care if the user has more than one screen). 为了实现停靠效果,请创建一个非常薄的(例如2px宽),无装饰的全透明窗口作为应用程序的主窗口,并将其固定在桌面的边缘(如果用户有更多操作,则需要格外小心)多于一个屏幕)。 When the mouse cursor hovers towards that area, reveal your primary user interface (eg your custom dock ). 当鼠标指针悬停在该区域时,显示您的主要用户界面(例如,您的自定义底座 )。

To hide the menu bar (like the Dock) application, call NSApplication setPresentationOptions: with NSApplicationPresentationHideMenuBar . 要隐藏菜单栏(如Dock)应用程序,请使用NSApplicationPresentationHideMenuBar调用NSApplication setPresentationOptions:

Finally to hide the icon call TransformProcessType with kProcessTransformToForegroundApplication . 最后,使用kProcessTransformToForegroundApplication隐藏图标调用TransformProcessType

ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);

And now you have an application that docks to the screen. 现在,您有了一个停靠在屏幕上的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM