{ "name": "Toggle Borders and Caption From Window", "language": 0, "code": "using System;\r\nusing System.Drawing;\r\n// The 'windowHandle' parameter will contain the window handle for the:\r\n// - Active window when run by hotkey\r\n// - Window Location target when run by a Window Location rule\r\n// - TitleBar Button owner when run by a TitleBar Button\r\n// - Jump List owner when run from a Taskbar Jump List\r\n// - Currently focused window if none of these match\r\npublic static class DisplayFusionFunction\r\n{\r\n\tpublic static void Run(IntPtr windowHandle)\r\n\t{ \r\n\r\n\t\r\n\t\t//get the current style of the window \r\n\t\tBFS.WindowEnum.WindowStyle style = BFS.Window.GetWindowStyle(windowHandle); \r\n\t\t\r\n\t\t//if the window has any styling that we don't want, remove it\r\n\t\tif(BFS.Window.HasWindowStyle(BFS.WindowEnum.WindowStyle.WS_CAPTION, windowHandle) ||\r\n\t\t\tBFS.Window.HasWindowStyle(BFS.WindowEnum.WindowStyle.WS_SYSMENU, windowHandle) ||\r\n\t\t\tBFS.Window.HasWindowStyle(BFS.WindowEnum.WindowStyle.WS_THICKFRAME__SIZEBOX, windowHandle) ||\r\n\t\t\tBFS.Window.HasWindowStyle(BFS.WindowEnum.WindowStyle.WS_MINIMIZEBOX, windowHandle) ||\r\n\t\t\tBFS.Window.HasWindowStyle(BFS.WindowEnum.WindowStyle.WS_MAXIMIZEBOX, windowHandle))\r\n\t\t{\r\n\t\t\tRectangle bounds = BFS.Window.GetBounds(windowHandle);\r\n\t\t\t\r\n\t\t\tstyle &= ~BFS.WindowEnum.WindowStyle.WS_CAPTION;\r\n\t\t\tstyle &= ~BFS.WindowEnum.WindowStyle.WS_SYSMENU;\r\n\t\t\tstyle &= ~BFS.WindowEnum.WindowStyle.WS_THICKFRAME__SIZEBOX;\r\n\t\t\tstyle &= ~BFS.WindowEnum.WindowStyle.WS_MINIMIZEBOX;\r\n\t\t\tstyle &= ~BFS.WindowEnum.WindowStyle.WS_MAXIMIZEBOX;\r\n\t\t\t\r\n\t\t\tBFS.Window.SetSizeAndLocation(windowHandle, bounds.X, bounds.Y, bounds.Width, bounds.Height);\r\n\t\t}\r\n\t\telse //otherwise, make sure that the window has the styling\r\n\t\t{\t\t\r\n\t\t\tRectangle bounds = BFS.Window.GetClientRect(windowHandle);\r\n\t\t\t\r\n\t\t\tstyle |= BFS.WindowEnum.WindowStyle.WS_CAPTION;\r\n\t\t\tstyle |= BFS.WindowEnum.WindowStyle.WS_SYSMENU;\r\n\t\t\tstyle |= BFS.WindowEnum.WindowStyle.WS_THICKFRAME__SIZEBOX;\r\n\t\t\tstyle |= BFS.WindowEnum.WindowStyle.WS_MINIMIZEBOX;\r\n\t\t\tstyle |= BFS.WindowEnum.WindowStyle.WS_MAXIMIZEBOX;\r\n\t\t\t\r\n\t\t\tBFS.Window.SetSize(windowHandle, bounds.Width, bounds.Height);\r\n\t\t}\r\n\t\t\r\n\t\t//set the new style to the window \r\n\t\tBFS.Window.SetWindowStyle(style, windowHandle); \r\n\t\tBFS.Window.ToggleAlwaysOnTop(windowHandle);\r\n\t}\r\n}", "description": "", "references": "System.dll|System.Data.dll|System.Drawing.dll|System.Management.dll|System.Web.dll|System.Windows.Forms.dll|System.Xml.dll" }