---
title: windowRef
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindow/windowref
---

# windowRef

The Carbon window reference associated with the window, creating one if necessary.

## Declaration

```swift
var windowRef: UnsafeMutableRawPointer { get }
```

## Discussion

Discussion You can use this property to create a WindowRef for a window containing a Carbon control. Subsequent accesses to this property get the existing WindowRef. You use a WindowRef to create a Carbon window reference for a Cocoa window; this assists the integration of Carbon and Cocoa code and objects. For more information see the MacWindows.h header file.

## See Also

### Properties

- [backingLocation](appkit/nswindow/backinglocation-swift.property.md)
- [preferredBackingLocation](appkit/nswindow/preferredbackinglocation.md)
- [isOneShot](appkit/nswindow/isoneshot.md)
- [drawers](appkit/nswindow/drawers.md)
- [showsResizeIndicator](appkit/nswindow/showsresizeindicator.md)
- [isFlushWindowDisabled](appkit/nswindow/isflushwindowdisabled.md)
- [isAutodisplay](appkit/nswindow/isautodisplay.md)
- [graphicsContext](appkit/nswindow/graphicscontext.md)
