I'm doing some work for an IT customer, and they have a Windows remote app (Epicor P21) that creates a new Outlook message with pre-filled info. The issue is that the new message window appears beneath the main remote app window. I'm desperately trying to build a script to pull this email window to the front, and this is what I've gotten. When I test with manually created new message windows on my own computer, it works intermittently, but it never pulls the desired window forward on the customer computer. Could someone do a sanity check on what I've written here, or help me understand where I've got things wrong? Thanks in advance!
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;Automatically run EmailTemplateToFront every 250ms #Persistent #SingleInstance force Critical SetTimer, EmailTemplateToFront, 250 Return ;Automatically bring new message Outlook message windows to the front so clicking in the task bar is not necessary EmailTemplateToFront: DetectHiddenWindows, On SetTitleMatchMode RegEx SetTitleMatchMode, slow WinSet, AlwaysOnTop, On, Message \(HTML\) return