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
Sentfile01
6 discussion posts
Hi there! Just bought this software and i have to say its really cool! :)

I wonder if its possible to open a minimized window by pressing a hotkey? Lets say i have Chrome and Spotify open but there are minimized on the taskbar, what i want do is like press CTRL + F1 and then Spotify maximizes and maybe CTRL + F2 for Chrome. If so, is there more options for this? Like when i press CTRL + F3 Spotify opens on half of the screen and File explorer on the other half.

Hope i'm not to confusing.

Looking forward to learn more about Displayfusion.

Kind regards
Sentfile01
Oct 11, 2016  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
It sure is! You can do this with a Scripted Function, like so:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
windowHandle = BFS.Window.GetWindowByText("*Google Chrome");
BFS.Window.Restore(windowHandle);
BFS.Window.MoveToLeftMonitorHalf(windowHandle);
}
}


Here are the steps to set that up:
  • On the Settings > Functions tab, click "Add Scripted"
  • Delete the default code and paste in the code from above
  • Give it a name (i.e. "Restore Chrome and Move to Left Half"
  • Give it a key combination
  • Click OK, then OK again
  • Test it out!

  • Hope that helps :)
Oct 12, 2016  • #2
User Image
Sentfile01
6 discussion posts
Thanks for the reply Keith. All tho i don't get this to work, see attached image.
Says "
Compile Failed.
Line 0: Source file 'C:\Windows\TEMP\k25il1ym.0.cs' could not be found
Line 0: No source files specified"

I don't see this in the script, where do i choose what program i want to open in the taskbar?
Like if i want to have 2 minimized programs to open like Chrome and Spotify, don't i need to choose where i want them to open? Like what monitor and location?

I'm really new to DP so sorry for the dumb questions :P

Thanks again.
Kind regards
Sentfile01
• Attachment [protected]: 2016-10-13 19_28_37-Settings • DisplayFusion Pro 8.0.png [26,695 bytes]
Oct 13, 2016  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
That error usually occurs if your user doesn't have permissions to write to the C:\Windows\Temp folder. Try checking the permissions on that folder to make sure your use has Modify or Full Control permissions on it.

The sample I posted will find the Google Chrome window:

windowHandle = BFS.Window.GetWindowByText("*Google Chrome");

Restore it:

BFS.Window.Restore(windowHandle);

And move it to the left half of the monitor:

BFS.Window.MoveToLeftMonitorHalf(windowHandle);

You can tweak it for other applications by editing the first line to use the window title of the application you want it to affect. And with the last line, if you want it to move to the right monitor have, you can change it to BFS.Window.MoveToRightMonitorHalf(windowHandle);
Oct 13, 2016  • #4
User Image
Sentfile01
6 discussion posts
Ah, got it working now! Ok, thanks for the info. Is there any way i can chose on what monitor this should be working on? I got 3x monitors/taskbars and sometimes same applications minimized on taskbar on all monitors.

Also, lets say i got 2x Chrome windows open or 2x File explorer open but minimized. Is it possible to run this so both open? Like 1 on the right side and the other on the left side. When i try it now just one opens and then nothing happens.

Thanks for the help
Oct 13, 2016 (modified Oct 13, 2016)  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You could do those with Scripted Functions as well, but each one would be a separate script, and therefore a separate hotkey or titlebar button. Would you like a couple of sample scripts for those scenarios?
Oct 14, 2016  • #6
User Image
Sentfile01
6 discussion posts
Yeah, that would be really nice :) The problem now is that i want this function to be running on a specific monitor as i said before. Is it possible to force a function only to run on like monitor 2?
Oct 15, 2016  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, I'll see what I can do here :)
Oct 18, 2016  • #8
User Image
Sentfile01
6 discussion posts
Great, thanks a lot Keith :)
Oct 18, 2016  • #9
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I put together a script that should work for you. When you use the script, it will restore and position any Chrome windows on the monitor that the mouse is in.

Here's how to set it up:

  • Download the file attached to this post
  • On the Settings > Functions tab, click "Add Scripted"
  • Delete the default code and paste in the code from the downloaded file
  • Give it a name (i.e. "Restore and Tile Chrome Windows"
  • Give it a key combination
  • Click OK, then OK again

I hope this works for you!
• Attachment: Restore and Tile Chrome Windows.txt [2,214 bytes]
Oct 20, 2016  • #10
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)