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?

Confirm

Are you sure?

User Image
Pierre Henri Parneix
3 discussion posts
Hello from France, I need a macro :
Focus the windows called : Komplete Kontrol
and put this window (Komplete Kontrol) in the center of the screen.

Thank you for your help. ;)
1 day ago  • #1
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
I believe you emailed in as well and I've assigned that ticket over to one of our developers. We're a bit tied up right now but we'll follow-up through email. :)
6 hours ago  • #2
User Image
JLJTGR
134 discussion posts
Your exact requirements don't work very well. With only a window title, the script must scan the window titles of all processes which can take 2-3 minutes because of protected processes or processes without windows probably causing issues. So I won't give you that script.

If you can supply this script the EXE name instead of the window title, that works near instantly.

Code

using System;
using System.Drawing;
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        IntPtr window = BFS.Application.GetMainWindowByFile(@"*\ApplicationFilename.exe");
        if (window != null)
        {
            Rectangle monitorRect = BFS.Monitor.GetMonitorBoundsByWindow(window);
            Rectangle windowRect = BFS.Window.GetBounds(window);
            Point newLocation = new Point(monitorRect.X + (monitorRect.Width / 2) - (windowRect.Width / 2),
                                        monitorRect.Y + (monitorRect.Height / 2) - (windowRect.Height / 2));
            BFS.Window.SetLocation(window, newLocation.X, newLocation.Y);
            BFS.Window.Focus(window);
        }
    }
}
2 hours ago  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)