IWinApplicationClass.CursorPosition

Fore Syntax

CursorPosition: IGxPoint;

Fore.NET Syntax

CursorPosition: Prognoz.Platform.Interop.Drawing.GxPoint;

Description

The CursorPosition property returns the point containing current screen coordinates of mouse cursor.

Fore Example

Executing the example requires a form and a button named Button1 on the form.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    CurPosition: IGxPoint;
Begin
    CurPosition := WinApplication.CursorPosition;
    Self.Text := CurPosition.X.ToString + 
" | " + CurPosition.Y.ToString;
End Sub Button1OnClick;

On clicking the button the console window displays current screen coordinates of the mouse cursor.

Fore.NET Example

Executing the example requires a .NET form with a button.

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Ui;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    WinAppCls: WinApplicationClass = New WinApplicationClassClass();
    CurPosition: GxPoint;
Begin
    CurPosition := WinAppCls.CursorPosition;
    Self.Text := CurPosition.X.ToString() + " | " + CurPosition.Y.ToString();
End Sub;

On clicking the button the form title displays current screen coordinates of the mouse cursor.

See also:

IWinApplicationClass