SetFocus() is not an exact science and comes without such guarantees. If at all possible, I would avoid its use. AFAIK you cannot reliably SetFocus() to a window that does not have a title, especially application modal child windows of a parent window.

That said, there is a product called AutoIT that stands head and shoulders above KiX for this sort of thing.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.