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:
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!