Thanks, but I found another solution:
Now I use the optional parameter owner (type IWin32Window) to specify the application/window the messagebox belongs to.