Since UAC, the SetForegroundWindow or ShowWindows methods of user32.dll do not always work.
E.g. if you want to activate an existing process window that has never been to the foreground before, it sometimes only appears partly behind the currently active window. Usually, this behaviour is not easy to be reproduced.
However, this site shows a workaround which solves the problem, at least in my case.