Task

Get the current location of the mouse cursor relative to the active window.

Please specify if the window may be externally created.




 
using System;
using System.Windows.Forms;
static class Program
{
    [STAThread]
    static void Main()
    {
        Console.WriteLine(Control.MousePosition.X);
        Console.WriteLine(Control.MousePosition.Y);
    }
}
 