OK I ssem to have figured the problem out. I had a program called WorkRave that reminds you to take regular breaks from typing (RSI prevention), and when it does this it steals focus. I removed it from the start up load and now Windows works as I expect it to.