Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

A recent AVG and Avast antivirus update is preventing DisplayFusion 9.9 from launching on some systems.
If you're running into this issue, please update to the latest DisplayFusion 10.0 Beta.

Get the Window Under the Mouse Cursor

Description
This script will show a dialog box with the window title of the window that the mouse cursor is over.
Language
C#.net
Minimum Version
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Sep 4, 2018
Date Last Modified
Sep 4, 2018

Scripted Function (Macro) Code

using System;
using System.Drawing;
using System.Windows.Forms;

public static class DisplayFusionFunction
{
    [System.Runtime.InteropServices.DllImport("user32.dll")]
    private static extern IntPtr WindowFromPoint(Point pnt);

	public static void Run(IntPtr windowHandle)
	{        
        IntPtr windowUnderMouse = WindowFromPoint(Cursor.Position);
        BFS.Dialog.ShowMessageInfo(BFS.Window.GetText(BFS.Window.GetParentRoot(windowUnderMouse)));
	}
}