Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
holodrum
3 discussion posts
I'm trying to figure out whether it's possible or not to create a single hotkey that does the following multifunction:

1. If application isn't running, launch it.
2. If application is running and minimized, maximize it.
3. If application is running and maximized, minimize it.

Any help appriciated!
Nov 9, 2021  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

The following script should be able to do this for you. You can import it via the DisplayFusion Settings > Functions > Scripted Function > Import Scripted Function.

You can specify the application you want it to work with on lines 15, 18, and 31. I've added in Notepad as an example.

Thanks!
Nov 9, 2021  • #2
User Image
holodrum
3 discussion posts
Hi Owen,

I appreciate the answer, and I'm looking forward to testing the script out, but I'm a little confused as to where I'm supposed to get the script you are mentioning?

Was it supposed to be attached to your post?
Nov 9, 2021 (modified Nov 10, 2021)  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Whoops, sorry! I guess it would help if I attached it :)
Nov 10, 2021  • #4
User Image
holodrum
3 discussion posts
Haha, no worries, I really appreciate the script, it's exactly what I was looking for! :)

However, some applications do not like being maximized directly from a minimized state, especially when it's minimized to tray, it's kinda interesting.

Discord being one of them.

I becomes this semi frozen window where it's basically a picture of the last "working" state of Discord.

It's not an issue with DisplayFusion, it's a general Windows issue, I have seen the same thing happen to other applications throughout the years. People that have experienced it knows what I'm talking about.

So, instead of minimizing/maximizing, I think the solution might be to minimize/restore the window instead, so, I tried editing the script, but, I'm no coding wizard, and clearly, you can't just switch out BFS.Window.Maximize with BFS.Window.Restore in the script.

I also tried to make a seperate script where instead of regular minimize, it minimize to tray, but haven't quiet figured it out yet :laugh:
Nov 13, 2021  • #5
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

I played around with the restore function, but I couldn't seem to get it to fire on a tray window, like Discord. Let me test it out a bit more on my end and I'll let you know if I can find a solution.

Thanks!
Nov 16, 2021  • #6
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

Just an update on this, it doesn't look like this is possible with our current functions as those windows are tricky to hook, but I've added this to our feature request list. We don't guarantee that feature requests will be implemented, or offer timelines on possible implementation. We'll be sure to let you know if we do add it to our planned features in a future version.

Thanks!
Dec 1, 2021  • #7
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)