Device.SetCursorPosition(Int32,Int32,Boolean) Method (Microsoft.DirectX.Direct3D)

Sets the cursor position and update options.


Visual Basic Public Sub SetCursorPosition( _
    ByVal positionX As Integer, _
    ByVal positionY As Integer, _
    ByVal updateImmediate As Boolean _
C# public void SetCursorPosition(
    int positionX,
    int positionY,
    bool updateImmediate
C++ public:
void SetCursorPosition(
    int positionX,
    int positionY,
    bool updateImmediate
JScript public function SetCursorPosition(
    positionX : int,
    positionY : int,
    updateImmediate : boolean


positionX System.Int32
New X-position of the cursor in virtual desktop coordinates. See Remarks.
positionY System.Int32
New Y-position of the cursor in virtual desktop coordinates. See Remarks.
updateImmediate System.Boolean
Set to true if the system guarantees that the cursor is updated at a minimum of half of the display refresh rate, but never more frequently than the display refresh rate. Set to false if the method delays cursor updates until the next Device.Present call.

Setting this parameter to false usually results in better performance. However, applications should use true if the rate of calls to Present is low enough that users would notice a significant delay in cursor motion. This flag has no effect in an application in windowed mode. Some video cards implement hardware color cursors; this flag does not affect these cards.


When running in full-screen mode, screen space coordinates are the back buffer coordinates appropriately scaled to the current display mode. When running in windowed mode, screen space coordinates are the desktop coordinates. The cursor image is drawn at the specified position minus the hot spot offset specified by Device.SetCursorProperties.

If the cursor is hidden by Device.ShowCursor, it is not drawn.

See Also