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
Centre and Focus Outlook Reminder Windows
Return to DisplayFusion Scripted Functions (Macros)
Description
This is a script that loops in the background, looking for new Outlook reminder windows that need to be brought to the front of the z-order. This is a workaround because Window Created Trigger rules don't work with Outlook, due to the fact that they re-use window handles from closed windows.
Language
C# (.Net)
Minimum Version
9.7+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Jul 29, 2020
Date Last Modified
Jul 29, 2020
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; using System.Collections.Generic; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Set the amount of time (in milliseconds) between loops (lowering this time will increase CPU usage) uint waitTime = 1000; // Script setup stuff var previousList = new List<IntPtr>(); var currentList = new List<IntPtr>(); while (true) // Loop forever (exit the script via its icon in the system tray) { // Clear the current list of windows currentList.Clear(); BFS.General.LogText("FocusNewOutlookReminderWindows: Current list cleared: " + currentList.Count.ToString()); // Add the current Outlook or Word window handles to a list foreach (IntPtr window in BFS.Window.GetVisibleAndMinimizedWindowHandles()) { if ((BFS.Application.GetMainFileByWindow(window).ToLower().Contains("outlook.exe") && BFS.Window.GetText(window).Contains("Reminder"))) { currentList.Add(window); BFS.General.LogText("FocusNewOutlookReminderWindows: Window added to current list: " + window.ToString() + " " + currentList.Count.ToString()); } } // Compare the list from the previous run to the list from the current run foreach (IntPtr window in currentList) { if (!(previousList.Contains(window))) { BFS.Window.MoveToCentreMonitor(window); BFS.Window.Focus(window); BFS.General.LogText("FocusNewOutlookReminderWindows: Reminder window focused" + ": " + window.ToString()); previousList.Add(window); BFS.General.LogText("FocusNewOutlookReminderWindows: Window added to previous list: " + window.ToString() + " " + previousList.Count.ToString()); } } // If the previous list has windows that aren't in the new list, mark them for deletion var closedWindows = new List<IntPtr>(); foreach (IntPtr window in previousList) { if (!(currentList.Contains(window))) { closedWindows.Add(window); BFS.General.LogText("FocusNewOutlookReminderWindows: Window marked for deletion: " + window.ToString()); } } // Delete the closed windows from the previous list foreach (IntPtr window in closedWindows) { previousList.Remove(window); BFS.General.LogText("FocusNewOutlookReminderWindows: Window deleted: " + window.ToString() + " " + previousList.Count.ToString()); } // Wait before looping to prevent the CPU from running up BFS.General.ThreadWait(waitTime); } } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch