Want to earn a free DisplayFusion Pro license? We're looking for DisplayFusion translators!
<< DiscussionsReply

Script to move windows on Monitors

Avatar from Gravatar.com
Jan Müller40182
1 discussion post
Hey Guys could use some help :).
We have a script to move some Acrobat Reader Files to a specific Monitor but can't figure out whats wrong with it atm.
Heres the script.
Maybe one of you knows whats wrong with it.

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
// - Active window when run by hotkey
// - Trigger target when run by a Trigger rule
// - TitleBar Button owner when run by a TitleBar Button
// - Jump List owner when run from a Taskbar Jump List
// - Currently focused window if none of these match
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
BFS.General.ThreadWait(250);
if (BFS.Window.GetText(windowHandle).Contains("Adobe Acrobat Reader DC - 1"))
BFS.Window.MoveToMonitorMaximized(1, windowHandle);
else if (BFS.Window.GetText(windowHandle).Contains("Adobe Acrobat Reader DC - 2"))
BFS.Window.MoveToMonitorMaximized(2, windowHandle);
else if (BFS.Window.GetText(windowHandle).Contains("Adobe Acrobat Reader DC - 3"))
BFS.Window.MoveToMonitorMaximized(3, windowHandle);
}
}
17 days ago  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
It might be that the text you're checking for is backwards. On my system, the window text for the Adobe Reader window is like this:

"Filename - Adobe Acrobat Reader DC"
16 days ago  • #2
Was this helpful?  Login to Vote  Login to Vote
<< DiscussionsReply
Visit DisplayFusion on FacebookVisit DisplayFusion on TwitterVisit DisplayFusion on Google+Visit DisplayFusion on LinkedInSearch for DisplayFusion on RedditFollow DisplayFusion on RSSVisit DisplayFusion on Instagram
Copyright © 2007-2018 Binary Fortress Software • News • Discussions • 常見問題集 • 支援 • Privacy • ToS

Title

Message