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
Open 2 Applications and Switch Between Them Every 15 Seconds
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will launch 2 applications (set their paths on lines 9 and 10) and toggle between them every 15 seconds.
Language
C#.net
Minimum Version
9.4.3+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Mar 12, 2019
Date Last Modified
Mar 12, 2019
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Drawing; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Set the application paths here string app1Path = @"C:\Windows\notepad.exe"; string app2Path = @"C:\Program Files\Notepad++\Notepad++.exe"; // Launches the applications uint app1ID = BFS.Application.Start(app1Path); uint app2ID = BFS.Application.Start(app2Path); // Gets their main windows IntPtr app1Window = BFS.Application.GetMainWindowByAppID(app1ID); IntPtr app2Window = BFS.Application.GetMainWindowByAppID(app2ID); // Changes focus every 15 seconds // To cancel, right-click the tray icon for the script and choose "Stop Script" while (true) { BFS.Window.Focus(app1Window); BFS.General.ThreadWait(15000); BFS.Window.Focus(app2Window); BFS.General.ThreadWait(15000); } } }