Some automation jobs may require SetForegroundWindow in order to use keyboard/mouse actions on another app. Of course this would require: 1. A user requesting it 2. A warning window telling the user he shouldn't touch anything until told otherwise. 3. The automation stuff 4. A notification to the user all is over. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.