using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run() { //make a list of websites you would like to have opened string[] websites = { "http://www.clipboardfusion.com/", "http://www.fileseek.ca/", "http://www.itunesfusion.com/", "http://www.logfusion.ca/", "http://www.wallpaperfusion.com/" }; string applicationPath = "c:\\windows\\system32\\notepad.exe"; //get the monitor ids uint[] monitorIds = BFS.Monitor.GetMonitorIDs(); //if we were unable to get the monitor Ids, exit if (monitorIds.Length == 0) return; //loop until the end of monitors, or websites for (int i = 0; i < websites.Length; i++) { //get the website url string website = websites[i]; //get the monitor id and ensure we dont get an array out of bounds exception uint monitor = monitorIds[i % monitorIds.Length]; //open the website in a new window and caputre its handle IntPtr window = BFS.Web.OpenUrlNewWindow(website); //if we failed to get the handle, continue to next loop iteration if(window == IntPtr.Zero) continue; //move the window to the specified monitor BFS.Window.MoveToMonitorMaximized(monitor, window); } //launch the application and move it to monitor 6, maximized uint appID = BFS.Application.Start(applicationPath); BFS.General.ThreadWait(1000); BFS.Window.MoveToMonitorMaximized(6, BFS.Application.GetMainWindowByAppID(appID)); } }