Take ScreenShot without Window
问题 I've been studying Son Of Grab Apple demo and I'm really struggling to get a screenshot of screen without any window (only desktop, dock and menu bar). Does anyone knows how to do so? 回答1: Here's some example code which takes a screenshot with just the desktop. CFArrayRef onScreenWindows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, kCGNullWindowID); CFArrayRef nonDesktopElements = CGWindowListCreate(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements,