{ "name": "Open and Close the Windows Settings", "language": 0, "code": "using System;\r\nusing System.Drawing;\r\n\r\npublic static class DisplayFusionFunction\r\n{\r\n\tpublic static void Run(IntPtr windowHandle)\r\n\t{\r\n // Windows Settings is a UWP app, so we have to launch it in a weird way\r\n\t\tBFS.Application.Start(\"cmd.exe\", \"/c start ms-settings:taskbar\");\r\n\t\t\r\n\t\t// Check for up to 10 seconds for the Settings window and close it when it's found\r\n\t\tfor (int i = 1; i < 10; i++)\r\n\t\t{\r\n // Try to find the window\r\n IntPtr window = BFS.Window.GetWindowByTextExact(\"Settings\");\r\n \r\n // Check if the window handle is null, if it's not, then close the window\r\n if (window != IntPtr.Zero)\r\n {\r\n BFS.Window.Close(window);\r\n break;\r\n }\r\n \r\n // Wait 1 second before checking for the window again\r\n BFS.General.ThreadWait(1000);\r\n\t\t}\r\n\t}\r\n}", "description": "", "references": "System.Core.dll|System.Data.dll|System.dll|System.Drawing.dll|System.Management.dll|System.Web.dll|System.Windows.Forms.dll|System.Xml.dll" }