using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
// The 'windowHandle' parameter will contain the window handle for the:
// - Active window when run by hotkey
// - Window Location target when run by a Window Location rule
// - TitleBar Button owner when run by a TitleBar Button
// - Jump List owner when run from a Taskbar Jump List
// - Currently focused window if none of these match
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// flag to write to file or open Dialog
bool outputToNotepad = false;
// get visible window handles
IntPtr[] handles = BFS.Window.GetVisibleWindowHandles();
// build debug window text
string output = "";
for (int i = 0; i < handles.Length; i++)
output += string.Format("0x{0}: Location: {1, -37} {2}" + Environment.NewLine, handles[i].ToString("x8"), BFS.Window.GetBounds(handles[i]).ToString(), BFS.Window.GetText(handles[i]));
if (outputToNotepad)
{
// show messagebox with text in Notepad
string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/OpenWindowInformation.txt";
System.IO.File.WriteAllText(path, output);
BFS.Window.SetSizeAndLocation(BFS.Application.GetMainWindowByAppID(BFS.Application.Start(path,"")),0,0,977,544);
}
else
{
// show messagebox with text in Dialog Box
BFS.Dialog.ShowMessageInfoMonospaced(output);
}
}
}