---
title: "windowNumber(at:belowWindowWithWindowNumber:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nswindow/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.

## Declaration

```swift
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

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

## Discussion

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.

## See Also

### Handling Mouse Events

- [acceptsMouseMovedEvents](appkit/nswindow/acceptsmousemovedevents.md)
- [ignoresMouseEvents](appkit/nswindow/ignoresmouseevents.md)
- [mouseLocationOutsideOfEventStream](appkit/nswindow/mouselocationoutsideofeventstream.md)
- [trackEvents(matching:timeout:mode:handler:)](appkit/nswindow/trackevents(matching:timeout:mode:handler:).md)
- [performDrag(with:)](appkit/nswindow/performdrag(with:).md)
- [foreverDuration](appkit/nsevent/foreverduration.md)
