Keeping the window I’m typing in at the front
Problem: When the agent sets a value in a background window, Windows sometimes brings that window to the front, and my typing lands in the wrong place.
Fix: Two layers. The UI Automation client is created with automatic focus turned off. Before each action Slipwing records the foreground window, and if the target’s program holds the foreground afterwards it puts the earlier window back, trying up to 3 times. If Windows refuses, the whole script stops and no more input is sent. In the test a note in front receives one character every 150 ms. Over three runs it missed none: 58 of 58, 55 of 55, 51 of 51.




