Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
CloudShow Manager
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
TrayStatus
VoiceBot
WallpaperFusion
Display
Fusion
by Binary Fortress Software
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
Features
Free vs Pro
More
Screenshots
Scripted Functions (Macros)
Languages
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Purchase
Login / Register
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Auto-Save Desktop Icon Profiles
Return to DisplayFusion Scripted Functions (Macros)
Description
This functions runs forever and automatically saves your desktop icon profile every N minutes.
Language
C#.net
Minimum Version
7.0.0+
Created By
kaweksl513742
Contributors
-
Date Created
Jan 5, 2015
Date Last Modified
Jan 5, 2015
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Collections.Generic; using System.Drawing; // Function saves icons layout automatically every some time // Number after M means active monitoru count that layout is for // // It's needed for me since I enable monitors on demand with monitor profiles // and icon saving its not relevant to monitor but overall desktop/multiple monitors // // * You may want to disable Icons save notification in Advanced Settings // * If you want to start this function with logon put that into autostart // <PathToDisplayFusion>\DisplayFusionCommand.exe -functionrun "Icons AutoSave" // public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Refresh every n minutes const int refreshRate = 20; //Number of saves per Monitor setup const int MaxSaves = 3; int saveNr = 1; string saveAs = ""; while (true) { if (saveNr > MaxSaves) saveNr = 1; Rectangle OverallRes = new Rectangle(0, 0, 0, 0); Rectangle[] MBounds = BFS.Monitor.GetMonitorBounds(); for (int i = 0; i < MBounds.Length; i++) OverallRes = Rectangle.Union(OverallRes, MBounds[i]); //MBounds.Length == active monitors number saveAs = string.Format("AutoSave_M{0}_{1}x{2}_{3}", MBounds.Length, OverallRes.Width,OverallRes.Height,saveNr); BFS.DisplayFusion.SaveDesktopIconsProfile(saveAs); BFS.General.Sleep(refreshRate*60*1000); saveNr++; } } }