Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

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)));
	}
}