window floating above desktop but behind everything else

守給你的承諾、 提交于 2019-12-11 13:07:01

问题


I have my app all setup to do what i want it to do. But there is one thing i can't figure out how to do. How do i make the window appear on the desktop. As in its like on your desktop and it will be above the desktop, but behind everything else.

I haven't figured out how to do this... Any ideas??


回答1:


Found the key you are looking for is: kCGDesktopWindowLevelKey, had a look for example and found Re: NSWindow order back and stay, dammit! -Applle mailing list

"I think it would be better to do CGWindowLevelForKey(kCGDesktopWindowLevelKey)+1, to make sure it's above the regular desktop, but below everything else.."

This Seems to work.

CGWindowLevel  desktopWinLevel =  CGWindowLevelForKey(kCGDesktopWindowLevelKey)+1;
[desktopWinLevel setLevel:winLevel];


来源:https://stackoverflow.com/questions/4775154/window-floating-above-desktop-but-behind-everything-else

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!