<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/frameRect(forContentRect:styleMask:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(cm)frameRectForContentRect:styleMask:"
  },
  "title" : "frameRect(forContentRect:styleMask:)"
}
-->

# frameRect(forContentRect:styleMask:)

Returns the frame rectangle used by a window with a given content rectangle and window style.

```
class func frameRect(forContentRect cRect: NSRect, styleMask style: NSWindow.StyleMask) -> NSRect
```

## Parameters

`cRect`

The content rectangle for a window expressed in screen coordinates.

`style`

The window style for the window. See [`NSWindow.StyleMask`](/documentation/AppKit/NSWindow/StyleMask-swift.struct) for a list of style mask values.

## Return Value

The frame rectangle, expressed in screen coordinates, used by the window with `cRect` and `style`.

## Discussion

When a `NSWindow` instance is available, you should use [`frameRect(forContentRect:)`](/documentation/AppKit/NSWindow/frameRect(forContentRect:)) instead of this method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)