Ok,
I noticed that I could not set focus on a window when XLobby was in front of that window. The sendmessage command or the send to front command didn't work.
This is probebly caused because windows doesn't allow a program which has no focus to give an other window focus.
(http://www.girder.nl/phpBB2/viewtopic.php?t=5600&highlight=foreground)
On the above page I found a program (sendfocus.exe) which can be launched from the event manager. You should use the window name as argument. Now when this event is triggerd, the sendfocus program is opend, as a new program it as focus and it is allowed to set focus to the window you specified, after which the program is terminated.
The only thing you see on the screen is the correct window in front of XLobby. Very nice.
Arthur