Login / Register
▼
Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
VoiceBot
WallpaperFusion
Home
▼
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
▼
Features
Features
Incredible Desktop Wallpaper
Monitor Configuration
Monitor Splitting
Powerful Functions
Triggers
Multi-Monitor Taskbars
Useful Windows 10 Tweaks
Useful Windows 8 Tweaks
Windows Lock Screen
Multi-Monitor Screen Savers
Monitor Fading
Window Snapping
Window Management
Mouse Management
Alt+Tab Handler
Window Position Profiles
Desktop Icon Profiles
Remote Control
Available in dozens of Languages
Easy Administration
Free vs Pro
Purchase
Screenshots
Languages
▼
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Scripted Functions (Macros)
Display
Fusion
by Binary Fortress Software
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Toggle Borders and Caption From Window
Return to DisplayFusion Scripted Functions (Macros)
Description
Toggles the borders and caption from a window on and off, and resizes the client window to the appropriate size.
Language
C# (.Net)
Minimum Version
7.1.0+
Created By
Thomas Malloch (BFS)
Contributors
enteleform
Date Created
Mar 18, 2015
Date Last Modified
Dec 4, 2017
Scripted Function (Macro) Code
Copy
Select All
//## Default (DisplayFusion) ##// using System; using System.Data; using System.Drawing; using System.Management; using System.Web; using System.Windows.Forms; using System.Xml; //## Default ##// using System.Runtime.InteropServices; public static class DisplayFusionFunction{ /*#####################################################################################################################################################################################################################################################################################################~{*/ /*//////| Run |////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////g2*/ /*#####################################################################################################################################################################################################################################################################################################~}*/ public static void Run(IntPtr windowHandle){ if(verify_IgnoredWindow(windowHandle)) {return;} if(! verify_IgnoredStyleWindow(windowHandle)){ remove_Border (windowHandle); maximize_Window(windowHandle); } else {BFS.Window.Maximize(windowHandle);} } /*#####################################################################################################################################################################################################################################################################################################~{*/ /*//////| Ignored Windows |/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////g2*/ /*#####################################################################################################################################################################################################################################################################################################~}*/ static string[] IGNORED_WINDOW_CLASSES = new string[]{ //## System ##// "MultitaskingViewFrame", // Windows Alt-Tab & Win-Tab Screens "Progman", // Windows Desktop "WorkerW", // Windows Desktop "ApplicationFrameWindow", // Windows Settings "Windows.UI.Core.CoreWindow", // Windows System Menus "NotifyIconOverflowWindow", // Windows System Tray "TaskManagerWindow", // Windows Task Manager "Shell_TrayWnd", // Windows Taskbar "TaskListThumbnailWnd", // Windows Taskbar Thumbnail //## Apps ##// "ClassicShell.CMenuContainer", // ClassicStart "ExplorerBrowserOwner", // Fences "WMP Skin Host", // Windows Media Player Visualizer "CWmpControlCntr", // Windows Media Player Visualizer (Full-Screen) }; static string[] IGNORED_WINDOW_STYLE_CLASSES = new string[]{ //## System ##// "CabinetWClass", // Windows File Explorer //## Apps ##// "GomPlayer1.x", // GOM Player "Chrome_WidgetWin_1", // Google Chrome "ThunderRT6Main", // XYplorer "ThunderRT6FormDC", // XYplorer }; /*#####################################################################################################################################################################################################################################################################################################~{*/ /*//////| Utils |////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////g2*/ /*#####################################################################################################################################################################################################################################################################################################~}*/ static bool verify_IgnoredWindow(IntPtr windowHandle){ string windowClass = BFS.Window.GetClass(windowHandle); return (Array.IndexOf(IGNORED_WINDOW_CLASSES, windowClass) >= 0); } static bool verify_IgnoredStyleWindow(IntPtr windowHandle){ string windowClass = BFS.Window.GetClass(windowHandle); return (Array.IndexOf(IGNORED_WINDOW_STYLE_CLASSES, windowClass) >= 0); } static BFS.WindowEnum.WindowStyle[] borderedWindowStyles = new BFS.WindowEnum.WindowStyle[]{ BFS.WindowEnum.WindowStyle.WS_CAPTION, BFS.WindowEnum.WindowStyle.WS_SYSMENU, BFS.WindowEnum.WindowStyle.WS_THICKFRAME__SIZEBOX, BFS.WindowEnum.WindowStyle.WS_MINIMIZEBOX, BFS.WindowEnum.WindowStyle.WS_MAXIMIZEBOX, }; static void remove_Border(IntPtr windowHandle){ BFS.WindowEnum.WindowStyle style = BFS.Window.GetWindowStyle(windowHandle); foreach(BFS.WindowEnum.WindowStyle subStyle in borderedWindowStyles) {style &= ~subStyle;} BFS.Window.SetWindowStyle(style, windowHandle); } static void maximize_Window(IntPtr windowHandle){ Rectangle monitor = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle); SetWindowPos(windowHandle, 0, monitor.X, monitor.Y, monitor.Width, monitor.Height, (SWP_NOZORDER | SWP_SHOWWINDOW)); } [DllImport("user32.dll")] static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags); const short SWP_NOZORDER = 0x4; const int SWP_SHOWWINDOW = 0x0040; }// /DisplayFusionFunction
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch