Windows Foreground Timeout

Overview 

From time to time, some applications may steal focus on a presently active window by forcing itself to "pop-up" in front of that window. This behavior can become quite annoying when, for instance, you are typing into a Word document and all of a sudden, a warning dialog pops up and steals focus resulting in half your keystrokes no longer being typed onto the original document. The Windows Foreground Timeout feature in Microsoft Windows operating systems is typically used to prevent other applications from focusing or changing the order of windows on a system without direct user interaction, unless the application has been accessed within a set period of time. In other words, when another application pops up on the desktop, Windows prevents it from stealing focus because it thinks the user would be interrupted if it allowed it to proceed. Whenever you've seen a window title entry in the Task Bar blinking, that is Windows Foreground Timeout in action.

The Windows Foreground Timeout feature is useful in most situations. However, in an unattended, automation environment, this feature can be quite problematic because it can prevent an Automate Desktop task from properly focusing specific windows during execution of a Focus window activity (or other actions used to automate UI interactions). For instance, if a task runs that initially sends keystrokes to Window A and immediately focuses Window B in order to send keystrokes to that window, the Foreground Timeout feature will prevent Window B from focusing, eventually failing the send keystrokes step from properly sending keystrokes to the correct window or causing errors such as The system cannot find the window specified or Window cannot be focused. To prevent such issues from occurring, Windows Foreground Timeout must be disabled.

Disabling Windows Foreground timeout

Automate Desktop encompasses a Disable Windows Foreground timeout preference that disables Windows Foreground Timeout throughout the system, allowing tasks to properly interact with appropriate windows. Disabling Windows Foreground Timeout also resolves analogous issues related to the focusing of windows. When this preference is checked, it will set Windows Foreground Timeout to 0, effectively disabling the feature.

To disable Windows Foreground timeout

  1. From Task Administrator, navigate to Options > System Settings > Execution.

  2. Add a check to the option titled Disable Windows Foreground timeout (as shown below).

  3. Click Apply to save the settings.

NOTE: Windows Foreground Timeout is a system feature. Turning this feature off from within Task Administrator (or any other means) will disable Windows Foreground Timeout entirely throughout the system.