Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Fabietto
18 discussion posts
Hi,
my requirement is to open one specific web page , on a specific monitor.
I tried different settings but I failed in my attempt .

I also downloaded the beta version , but the result is equally failed .

Someone help me ?

Best regards,
Krandall
• Attachment [protected]: 00120.JPG [111,101 bytes]
• Attachment [protected]: 00121.JPG [106,637 bytes]
Mar 15, 2015  • #1
User Image
solaris765
40 discussion posts
Using Thomas Malloch's code as a base I put together this for you. let me know if you have any questions.

Code

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Window Location target when run by a Window Location 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)
{
//Set Website you want opened.
string website ="http://www.binaryfortress.com/";

//Monitor to be shown on.
uint monitor = 1;
/*
Standard selections would be : 1, 2, 3, etc.

If a monitor has sections i.e. 2.1, 2.2, 2.3
Your selections will include 201, 202, 203
*/

//open the website in a new window and caputre its handle
IntPtr window = BFS.Web.OpenUrlNewWindow(website);
 while (true)
 {
//if we failed to get the handle, continue to next loop iteration
if(window == IntPtr.Zero)
continue;
else break;
 }

//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor, window);

}
}
Mar 15, 2015  • #2
User Image
Fabietto
18 discussion posts
Thank yout for reply.

how to use and where to use this script ?

thx
Mar 15, 2015 (modified Mar 15, 2015)  • #3
User Image
solaris765
40 discussion posts
You can go to Display Fusion settings. and Under the Function tab hit "Add Scripted" then just copy and paste it into the code body.

then Name it and assign a Key Combination as usual.
Mar 15, 2015  • #4
User Image
Fabietto
18 discussion posts
there is the possibility of applying this code when I click on a shortcut to a web page on the desktop ?
• Attachment [protected]: 001.JPG [32,506 bytes]
Mar 15, 2015  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You sure can! Create a desktop shortcut to:

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

@solaris: Thanks for sharing that script :)
Mar 16, 2015  • #6
User Image
solaris765
40 discussion posts
No problem. I couldn't figure out the shortcut myself. So thanks for that as well!
Mar 16, 2015  • #7
User Image
Fabietto
18 discussion posts
Yes ! Yes! Is it :) This is exactly what I try .
I can also add the full screen mode ( same as pressing the ' F11 ' ? )

Thank you very much
Mar 18, 2015  • #8
User Image
Fabietto
18 discussion posts
Yes, is possible:

BFS.Input.SendKeys("{F11}");

:)

Thank you everyone!
Mar 18, 2015  • #9
User Image
Fabietto
18 discussion posts
Hi all,
I just updated the operating system ( W10 ) and the page opens but does not move the window to the other monitor.

It is necessary to adapt the script to the new S.O. ?

can someone help me ?

Best regards,
Fabio
May 3, 2016 (modified May 24, 2016)  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
The script should still work fine in Windows 10. Which web browser is set as your default browser?
May 24, 2016  • #11
User Image
Fabietto
18 discussion posts
Hi,
Chrome is set to default.

Version 50.0.2661.102
May 24, 2016  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, could you attach a copy of the complete script code? I'll re-test it here.

Thanks!
May 25, 2016  • #13
User Image
Fabietto
18 discussion posts
Hi, thank you for help.
The script is:

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
// - Active window when run by hotkey
// - Window Location target when run by a Window Location 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)
{
//Set Website you want opened.
string website ="http://www.dogs2015.com/Pages/LiveRacingDogs.aspx?sport_id=11";

//Monitor to be shown on.
uint monitor = 2;
/*
Standard selections would be : 1, 2, 3, etc.

If a monitor has sections i.e. 2.1, 2.2, 2.3
Your selections will include 201, 202, 203
*/

//open the website in a new window and caputre its handle
IntPtr window = BFS.Web.OpenUrlNewWindow(website);
while (true)
{
//if we failed to get the handle, continue to next loop iteration
if(window == IntPtr.Zero)
continue;
else break;
}
BFS.Input.SendKeys("{F11}");
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor, window);

}
}

thank you,
Fabio
May 25, 2016  • #14
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Thanks! It looks like the latest version of Chrome doesn't allow the full screen window to be moved after the fact, but thankfully it's easy to fix the script. Just move the following line:

Code

BFS.Window.MoveToMonitor(monitor, window);


above the following line:

Code

BFS.Input.SendKeys("{F11}");


That will make it move the window first, then make it full screen.

Hope that helps!
May 26, 2016  • #15
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)