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
Select a Random Wallpaper Profile with Filter
Return to DisplayFusion Scripted Functions (Macros)
Description
This script lets you specify some text to search for and selects a random Wallpaper Profile from the profiles that match that text.
Language
C#.net
Minimum Version
9.4.3+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Jan 28, 2019
Date Last Modified
Jan 28, 2019
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Collections.Generic; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Set the text to look for when building the list of Wallpaper Profiles to pick from string wallpaperSeason = "Winter"; // Build the list of Wallpaper Profiles that match the text List<string> wallpaperProfilePool = new List<string>(); foreach (string profile in BFS.DisplayFusion.GetWallpaperProfiles()) { if (profile.ToLower().Contains(wallpaperSeason.ToLower())) { wallpaperProfilePool.Add(profile); } } // Select a random profile from the list Random randomNumber = new Random(); string selectedRandomWallpaperProfile = wallpaperProfilePool[randomNumber.Next(0,wallpaperProfilePool.Count - 1)]; BFS.DisplayFusion.LoadWallpaperProfile(selectedRandomWallpaperProfile); } }