Edward Lane565973
2 discussion posts
I am using the below script to open up 9 separate instances of IE to a specific page and they go to the appropriate monitor. The issue i am having is i need each page to go fullscreen once all is loaded.
Any assistance on what i am doing wrong of if i am over thinking it any other recommendations are greatly appreciated as well. Basically i want the computer to start and DF to boot up and the process to happen. If it needs to be individual triggers then so be it but jut prefer the least amount of human interaction as possible.
We created a conference center display solution and need to present specific webpages to specific monitors.
TIA
Ed
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 roomA1 ="http:*******/RoomA1.aspx";
string roomA2 ="http:*******/RoomA2.aspx";
string roomA3 ="http:*******/RoomA3.aspx";
string roomA4 ="http:*******/RoomA4.aspx";
string roomB1 ="http:*******/RoomB1.aspx";
string roomB2 ="http:*******/RoomB2.aspx";
string roomC ="http:*******/RoomC.aspx";
string roomD1 ="http:*******/RoomD1.aspx";
string roomD2 ="http:*******/RoomD2.aspx";
//Monitor to be shown on.
uint monitor1 = 1;
uint monitor2 = 2;
uint monitor3 = 3;
uint monitor4 = 4;
/* uint monitor5 = 5;
uint monitor6 = 6;
uint monitor7 = 7;
uint monitor8 = 8;
uint monitor9 = 9;*/
//open the website in a new window and caputre its handle
IntPtr windowA1 = BFS.Web.OpenUrlNewWindow(roomA1);
IntPtr windowA2 = BFS.Web.OpenUrlNewWindow(roomA2);
IntPtr windowA3 = BFS.Web.OpenUrlNewWindow(roomA3);
IntPtr windowA4 = BFS.Web.OpenUrlNewWindow(roomA4);
/* IntPtr windowB1 = BFS.Web.OpenUrlNewWindow(roomB1);
IntPtr windowB2 = BFS.Web.OpenUrlNewWindow(roomB2);
IntPtr windowC = BFS.Web.OpenUrlNewWindow(roomC);
IntPtr windowD1 = BFS.Web.OpenUrlNewWindow(roomD1);
IntPtr windowD2 = BFS.Web.OpenUrlNewWindow(roomD2);*/
while (true) {
if(windowA1 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor1, windowA1);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowA2 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor2, windowA2);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowA3 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor3, windowA3);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowA4 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor4, windowA4);
BFS.Input.SendKeys("{F11}");
break;
}
}
/*while (true) {
if(windowB1 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor5, windowB1);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowB2 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor6, windowB2);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowC == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor7, windowC);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowD1 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor8, windowD1);
BFS.Input.SendKeys("{F11}");
break;
}
}
while (true) {
if(windowD2 == IntPtr.Zero) {
continue;
} else {
//move the window to the specified monitor
BFS.Window.MoveToMonitor(monitor9, windowD2);
BFS.Input.SendKeys("{F11}");
break;
}
}*/
}
}
Edward Lane565973
2 discussion posts
Office mate figured it out.
using System;
using System.Drawing;
public static class DisplayFusionFunction {
public static void Run(IntPtr windowHandle) {
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "-kiosk -new-window http://****RoomA1.aspx");
BFS.General.ThreadWait(2000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(1, windowHandle);
BFS.General.ThreadWait(2000);
BFS.Input.SendKeys("{F11}");
BFS.General.ThreadWait(2000);
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "-kiosk -new-window http://****RoomA2.aspx");
BFS.General.ThreadWait(2000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(2, windowHandle);
BFS.General.ThreadWait(2000);
BFS.Input.SendKeys("{F11}");
BFS.General.ThreadWait(2000);
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "-kiosk -new-window http://****RoomA3.aspx");
BFS.General.ThreadWait(2000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(3, windowHandle);
BFS.General.ThreadWait(2000);
BFS.Input.SendKeys("{F11}");
BFS.General.ThreadWait(2000);
BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "-kiosk -new-window http://****RoomA4.aspx");
BFS.General.ThreadWait(2000);
windowHandle = BFS.Window.GetFocusedWindow();
BFS.Window.MoveToMonitor(4, windowHandle);
BFS.General.ThreadWait(2000);
BFS.Input.SendKeys("{F11}");
BFS.General.ThreadWait(2000);
}
}