问题
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