Have a look into the Focus thread. I think you can use the
SetTimer in intervalls about 200 ms, then you check the getfocus, if it's 0 then you use the setfocus. That's it.