UI Automation switch window
问题 I've noticed that setforegroundwindow can be very flaky - no matter how you do it. I've noticed that using UIAutomation, where possible, seems to improve things. For example: Getting the WindowPattern and using something like: windowPattern.SetWindowVisualState( WindowVisualState.Normal ); windowPattern.SetWindowVisualState( WindowVisualState.Maximized ); Now my questions is: How do I know whether I should make it maximized or normal. The task manager, and dragon naturally speaking both seem