Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Soopsmojo
1 discussion post
I'm trying to a build the following trigger: When Zoom opens up for a meeting, open or bring to focus a PWA chrome app that I have installed. The app process is chrome since it's a Chrome PWA

I have the trigger running but the problem is that I can only get it to open a new window for the app and can't make it bring to focus the existing window if it's already open. At the end of the day I have around 5 or 6 instances/windows of the chrome app running which is annoying

How would you go about doing this?

In my trigger I did this

On creation of the zoom window....

1. Run custom function to kill any windows
uint appID = BFS.Application.GetAppIDByWindow(BFS.Window.GetWindowByText("[window title of chrome PWA]");
BFS.Application.Kill(appID)}

2. Open new window of PWA

But that custom funtion kills the whole chrome process and any existing windows I had of normal chrome and not just the window with that title.
Sep 30, 2020  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
If you're wanting to open it if it's not already open, you could do something like this:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        // Try to get the window
        IntPtr window = BFS.Window.GetWindowByText("windowtitlehere");
    
        // Check if the window exists
        if (window == IntPtr.Zero)
        {
            // If it doesn't exist, launch it
            // Insert code to launch the app here
        }
        else
        {
            // If it does exist, focus it
            BFS.Window.Focus(window);
        }
    }
}


Hope that helps!
Oct 2, 2020  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)