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
Charlie77
21 discussion posts
Hi Keith/all,

I'm hoping you can provide some insight on how to make a certain operation work.

Essentially, I have Alt+F hotkeyed to open Firefox. However, when I minimize Firefox (and do other tasks), if I hit Alt+F again, DF launches a newinstance of Firefox.

How can I have DF work such that when I hit Alt+F (when Firefox is already open but is minimized or behind other windows) Firefox is then maximized/brought to the forefront (and nothave Alt+F open a newinstance of Firefox)?

I've taken a quick look around the forum to see if such a topic was discussed previously, but I could not find anything.

Thank you for any help,

Charlie
Apr 26, 2017 (modified Apr 26, 2017)  • #1
PabloMartinez's profile on WallpaperFusion.com
You can use a simple script. This script checks to see if Firefox is running and if it is running, it maximize the window, otherwise it starts Firefox. Set your path to the Firefox in code and don't forget to add a "Key Combination".

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        var wHnd = BFS.Application.GetMainWindowByFile("*firefox.exe");

        if(!wHnd.Equals(IntPtr.Zero))
            BFS.Window.Maximize(wHnd);
        else
            BFS.Application.Start(@"C:\Program Files (x86)\Mozilla Firefox\firefox.exe", "");
    }
}


Maybe Keith will write about other ways.
Apr 26, 2017  • #2
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Thanks Pablo! That was going to be my response as well :)

@Charlie: Let us know if you have any trouble setting up Pablo's scripted function.
Apr 26, 2017  • #3
User Image
Charlie77
21 discussion posts
Thanks so much, Pablo and Keith!

The only thing I changed in the script was changing Window.Maximize to Window.Focus. This whole script now meets my needs perfectly, and I've also used it for Outlook and a few other programs.

Thank you again!!

Charlie
Apr 26, 2017  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Cheers!
Apr 27, 2017  • #5
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)