Login / Register
▼
Binary Fortress
Binary Fortress Software
ASP.NET ViewState Helper
CheckCentral
ClipboardFusion
CloudShow
DisplayFusion
FileSeek
HashTools
iTunesFusion
JigsawMania
LogFusion
Notepad Replacer
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
Precise Monitor Controls
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)
DisplayFusion
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Save Window Positions Using Window Titles (Layout1)
Return to DisplayFusion Scripted Functions (Macros)
Description
This function will get the bounds for all open windows, and save their locations to the registry. You can then restore them using the "Restore Window Positions Using Window Titles (Layout1)" script.
Language
C#
Minimum Version
7.3.1+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Sep 25, 2015
Date Last Modified
Sep 25, 2015
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // You can duplicate this script, then change layoutID to something different to save another layout string layoutID = "Layout1"; IntPtr[] windowHandles = BFS.Window.GetVisibleWindowHandles(); foreach (IntPtr window in windowHandles) { // Get the window title and bounds string windowTitle = BFS.Window.GetText(window); Rectangle windowBounds = BFS.Window.GetBounds(window); // If the window title isn't blank, write the window's x, y, width, and height values to the registry if (windowTitle != "") { BFS.ScriptSettings.WriteValue(windowTitle + "_X_" + layoutID, windowBounds.X.ToString()); BFS.ScriptSettings.WriteValue(windowTitle + "_Y_" + layoutID, windowBounds.Y.ToString()); BFS.ScriptSettings.WriteValue(windowTitle + "_width_" + layoutID, windowBounds.Width.ToString()); BFS.ScriptSettings.WriteValue(windowTitle + "_height_" + layoutID, windowBounds.Height.ToString()); } } } }
Copyright © 2007-2019 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch