Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Frank99's profile on WallpaperFusion.com
Is there a way to bring a window to the front every 15 minutes? I see how to do a timed trigger, and how to use it to run a custom function, but I can't figure out how to select a particular window.
Dec 4, 2018  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You'd have to use a Scripted Function for that. Is there only one window for the program? If so, what's the EXE name for the program? I'll write up a sample script :)
Dec 4, 2018  • #2
Frank99's profile on WallpaperFusion.com
The program is "ett.exe" and the window title bar says "Macromedia Flash Player 8". Only one window. Thanks!
Dec 5, 2018 (modified Dec 5, 2018)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, on the Settings > Functions tab, try adding a Scripted Function using this code:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        BFS.Window.Focus(BFS.Application.GetMainWindowByFile("*ett.exe"));
    }
}


Give it a key combination, apply the settings, then try the key combination, does it come to the front?4

Let me know how that works out. If it works, I'll let you know how to schedule it with a Trigger rule :)

Thanks!
Dec 5, 2018  • #4
Frank99's profile on WallpaperFusion.com
OK, it works with a key combination. What's next? I tried adding a trigger with a 900 sec timer interval, but it didn't work. Also, is there a way to trigger it for every 15 minutes by the clock (i.e. at 9:15 rather than at 15 minutes past whenever I happen to log on to the computer). Thanks!
Dec 8, 2018 (modified Dec 8, 2018)  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Can you attach a screenshot of the Trigger rule you created?
Dec 10, 2018  • #6
Frank99's profile on WallpaperFusion.com
Here it is.
• Attachment [protected]: Capture.PNG [34,728 bytes]
Dec 11, 2018  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
That looks like it should work. Do you see a tray notification when the Timer Interval fires every 15 minutes, saying that the ETT function is running?
Dec 12, 2018  • #8
Frank99's profile on WallpaperFusion.com
I probably turned tray notifications off, but I can't find the setting to check again.

Also, can you answer my question about bringing it to front at a specific time rather than just every 15 minutes after I boot? I want to log work at 10, 10:15, etc.
Dec 14, 2018  • #9
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Sorry, I missed that part of the question. There isn't a built-in way to schedule specific times. You could use the Windows Task Scheduler to run the function though. You'd create a task that runs DisplayFusionCommand.exe with the -funtionrun argument, like this:

"C:\Program Files (x86)\DisplayFusion\DisplayFusionCommand.exe" -functionrun "scripted function name"

The setting to disable tray notifications is in Settings > Advanced Settings, called "Don't show tray icon notification balloons."
Dec 14, 2018  • #10
User Image
MB1702
6 discussion posts
I did the above (created a script to bring one window to the front, created a time interval trigger), and it worked, thanks. But I also want that after DisplayFusion brings the specified app to the front (which it is doing), that the focus moves back immediately (and automatically) to the software I was using. Is that possible?
Jul 20, 2020  • #11
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
In your script you would need to get the currently focused window's handle, save that, then focus that window at the end of the script. :)
Jul 20, 2020  • #12
User Image
MB1702
6 discussion posts
Quote:
In your script you would need to get the currently focused window's handle, save that, then focus that window at the end of the script. :)


Thanks! Thing is... I don't know how to do this. I managed the rest because instructions were very specific, I just cut and pasted plus changed the "*.exe"...
Jul 21, 2020  • #13
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I modified the script to use with the Trigger to also focus your original window. Here it is:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        BFS.Window.Focus(BFS.Application.GetMainWindowByFile("*ett.exe"));
        
        // focus the original window handle
        BFS.Window.Focus(windowHandle);
    }
}


Hopefully this works for you!
Jul 22, 2020  • #14
User Image
MB1702
6 discussion posts
Thanks! It seems to be almost there. Previously, the windows brought to front would always become the active window. Now the behavior varies. I'll be more specific, maybe it helps.

I'm bringing the new Microsoft Edge to front. I tested your script with following:

- If I am using Word, and typing, it is bringing Edge to front, and when the trigger triggers it seems nothing becomes active. I press any key on the keyboard and nothing happens.

- If am using Roon (a music aggregator) where play/pause is Space key, it brings Edge to the front, but after, if I press Space, it is still in Edge and the webpage in Edge goes to the end as it is its behavior when pressing Space.

- Now, if I am using Spotify, which is similar to Roon, if after bringing Edge to front I press Space, nothing happens, like with Word.

In the case of my test, when I press Alt+Tab to Switch apps, it seems that the last active Window is indeed Word, Roon or Spotify even though the final behavior is as described above, where I can't do anything with these apps unless I click the mouse on them or use Alt+Tab.

What I would like is to have Edge in the front and be able to keep working, mostly typing, on the other apps without having to click anything or to use Alt+tab. It now seems to be in a middle ground (previously it would take me to Edge, and then Edge would become active)

To clarify, I have some Images of paintings in Edge and sometimes other apps cover it, thus I want to be able to see the full pictures as I am doing other stuff in other apps, which occupy other parts of my screen (it is a big monitor).

I do appreciate all the help so far, thanks so much.

Quote:
I modified the script to use with the Trigger to also focus your original window. Here it is:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        BFS.Window.Focus(BFS.Application.GetMainWindowByFile("*ett.exe"));
        
        // focus the original window handle
        BFS.Window.Focus(windowHandle);
    }
}


Hopefully this works for you!
Jul 22, 2020  • #15
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I thought of something else that you can try that might work for you. You wouldn't even need a Trigger or a Scripted Function for it. You could probably accomplish this with a title bar button that sets the Edge window to be "Always on Top". Here's how to do it:

  • Open the DisplayFusion Settings and click the Functions tab.
  • Find the "Toggle Window Always on Top" function in the list and select it.
  • Click the "Toggle TitleBar Button" button.
  • Click Apply.

Hope that helps!
Aug 7, 2020  • #16
User Image
MB1702
6 discussion posts
Quote:
I thought of something else that you can try that might work for you. You wouldn't even need a Trigger or a Scripted Function for it. You could probably accomplish this with a title bar button that sets the Edge window to be "Always on Top". Here's how to do it:

  • Open the DisplayFusion Settings and click the Functions tab.
  • Find the "Toggle Window Always on Top" function in the list and select it.
  • Click the "Toggle TitleBar Button" button.
  • Click Apply.

Hope that helps!


I was using another software to do this, as this was the viable solution I came up with as well, but it is better to stay with one less software and use DisplayFusion. Thanks!
Aug 17, 2020  • #17
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)