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

# windowNumber(at:belowWindowWithWindowNumber:)

Returns the number of the frontmost window that would be hit by a mouse-down at the specified screen location.

```
class func windowNumber(at point: NSPoint, belowWindowWithWindowNumber windowNumber: Int) -> Int
```

## Parameters

`point`

The location of the mouse-down in screen coordinates.

`windowNumber`

If non-0, the search will start below `windowNumber` window in z-order.

## Return Value

The window number of the window under the point. The window number returned may correspond to a window in another application.

## Discussion

Because this method uses the same rules as mouse-down hit-testing, windows with transparency at the given point, and windows that ignore mouse events, will not be returned.

---

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)