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
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Shrink restored when nearly maximum size
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will reduce the size of the window if it's nearly the full size of the screen but not actually maximized. It can be automated if run from a Trigger rule that uses the "Restore Window" Trigger Event.
Language
C# (.Net)
Minimum Version
9.5+
Created By
Charles7
Contributors
-
Date Created
Jul 8, 2019
Date Last Modified
Jul 22, 2019
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; // 20190720 ckx // Shrink restored when nearly maximum size (trigger on window restored). // Use with trigger: // 1) On window restored // 2) Window title <blank> // 3) Add this script to run public static class DisplayFusionFunction { public static void Run(IntPtr ha) { // set the scale amount // (greater than 1.0 increases window size, less than 1.0 decreases window size) float scaleAmount = 0.7f; // set the minimum size for the window (relative to the monitor's size) float minimumRelativeSize = 0.2f; /* === DO NOT MODIFY BELOW THIS LINE === */ if(BFS.Window.IsMaximized(ha)) return; Rectangle wbr = BFS.Window.GetBounds(ha); Rectangle mbr = BFS.Monitor.GetMonitorBoundsByWindow(ha); int dxd = Math.Abs( wbr.Width - mbr.Width ); int dyd = Math.Abs( wbr.Height - mbr.Height ); // ShoCoo(wbr,mbr,dxd,dyd); if ( dxd > (int)(wbr.Width * minimumRelativeSize) ) return; if (dyd > (int)(wbr.Height * minimumRelativeSize)) return; int fxd = (int)(wbr.Width * scaleAmount); int fyd = (int)(wbr.Height * scaleAmount); int fxp = (int)(mbr.X + (wbr.Width - fxd) / 2) ; int fyp = (int)(mbr.Y + (wbr.Height - fyd) / 2) ; BFS.Window.SetSizeAndLocation(ha, fxp, fyp, fxd, fyd ); } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch