Load Gaming Setup using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { BFS.DisplayFusion.RunFunction("Load Monitor Profile: Gaming"); BFS.General.Sleep(1000); BFS.DisplayFusion.RunFunction("Minimize All Windows"); BFS.General.Sleep(2000); BFS.DisplayFusion.RunFunction("Directory Opus Load Move and Resize"); BFS.General.Sleep(1000); BFS.DisplayFusion.RunFunction("Chrome Load Move and Resize"); BFS.General.Sleep(1000); BFS.DisplayFusion.RunFunction("Change Mouse Cursor Default"); BFS.General.Sleep(1000); BFS.DisplayFusion.RunFunction("Refresh Rainmeter"); } } Minimize All Windows using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { BFS.Input.SendKeys("{WIN}(M)"); } } Directory Opus Load Move and Resize using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Find out of Application is running bool appIsRunning = BFS.Application.IsAppRunningByFile("*dopus.exe"); //get the main window by it's executable name IntPtr mainWindow = BFS.Application.GetMainWindowByFile("*dopus.exe"); if (mainWindow == IntPtr.Zero){ //Launch the application (customize the path to match your application) uint appID = BFS.Application.Start("C:\\Program Files\\GPSoftware\\Directory Opus\\dopus.exe", ""); //Sleep to allow time for the window to open BFS.General.Sleep(250); mainWindow = BFS.Application.GetMainWindowByFile("*dopus.exe"); } //if the app is minimized, restore it if (BFS.Window.IsMinimized(mainWindow)) BFS.Window.Restore(mainWindow); //set focus to the main window BFS.Window.Focus(mainWindow); BFS.General.Sleep(100); BFS.DisplayFusion.RunFunction("Directory Opus Resize"); } } Chrome Load Move and Resize using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Find out if Chrome is running bool chromeIsRunning = BFS.Application.IsAppRunningByFile("*chrome.exe"); // If notepad is not running then start it if (!chromeIsRunning) { //Launch the application (customize the path to match your application) uint appID = BFS.Application.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", ""); //Sleep to allow time for the window to open BFS.General.Sleep(250); } //get the main window by it's executable name IntPtr mainWindow = BFS.Application.GetMainWindowByFile("*chrome.exe"); //if we failed to get the window, exit the function if (mainWindow == IntPtr.Zero) return; BFS.Window.Restore(mainWindow); //set focus to the main window BFS.Window.Focus(mainWindow); BFS.DisplayFusion.RunFunction("Chrome Resize"); } } Change Mouse Cursor Default using System; using System.Drawing; using System.Runtime.InteropServices; using Microsoft.Win32; public static class DisplayFusionFunction { //this function lets us tell windows that we changed the cursor [DllImport("user32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SystemParametersInfo(uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni); const uint SPI_SETCURSORS = 0x0057; public static void Run(IntPtr windowHandle) { //set the name of the mouse cursor set here, if you want to view a list, download the "Change Mouse Cursor (List)" script and run it //on most systems, the options are: "Magnified", "Windows Aero", "Windows Aero XL)", "Windows Black", "Windows Black (extra large)", "Windows Black (large)", "Windows Inverted", "Windows Inverted (extra large)", "Windows Inverted (large)", "Windows Standard (extra large)", "Windows Standard (large)" string cursor = "Windows Standard (large)"; //this will hold the paths to the cursor files (.cur) string[] cursorPaths; //open the selected registry entry and get the paths using(RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes", RegistryKeyPermissionCheck.ReadSubTree)) { //if we couldn't open the registry, tell the user and exit if (regKey == null) { BFS.Dialog.ShowMessageError("Unable to get cursor paths"); return; } //read the registry path object value = regKey.GetValue(cursor, ""); //the paths are seperated by commas, split up the string cursorPaths = value.ToString().Split(new char[]{','}); } //this is the order than the paths appear in the comma seperated path string[] pathKeys = new string[]{"Arrow", "Help", "AppStarting", "Wait", "Crosshair", "IBeam", "NWPen", "No", "SizeNS", "SizeWE", "SizeNWSE", "SizeNESW", "SizeAll", "UpArrow", "Hand", ""}; //if we don't have enough paths, tell the user and exit if(cursorPaths.Length < pathKeys.Length) { BFS.Dialog.ShowMessageError("Not enough paths"); return; } //open the registry and set the used cursor values to the new ones we found using(RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"Control Panel\Cursors", RegistryKeyPermissionCheck.ReadWriteSubTree)) { //if we couldn't open the registry, tell the user and exit if (regKey == null) { BFS.Dialog.ShowMessageError("Unable set cursors"); return; } //set each path for(int i = 0; i < pathKeys.Length; i++) regKey.SetValue(pathKeys[i], cursorPaths[i], RegistryValueKind.String); } //tell windows we changed the cursor so it gets updated SystemParametersInfo(SPI_SETCURSORS, 0, IntPtr.Zero, 0); } }