Bagikan melalui


Mouse.WindowHandle Property

Gets or sets the window used for mouse processing. Mouse coordinates returned by GetState are relative to the upper-left corner of this window.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public static IntPtr WindowHandle { get; set; }

Property Value

Handle to a window.

Remarks

By default, this property is set to the game window (Game.Window Property). To select a different window as the coordinate reference, set WindowHandle to that window.

If the mouse is above or to the left of the reference window, the returned coordinates are negative. If the mouse is below or to the right of the reference window, the returned coordinates are greater than the window's client area.

See Also

Tasks

Getting the Mouse Position (Windows, Windows Phone)

Concepts

Overview of User Input and Input Devices

Reference

Mouse Class
Mouse Members
Microsoft.Xna.Framework.Input Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone