moving window behind modal window

Can somebody help me understand this :

I have a main window with some textfields, listboxes, and other controls… In the open event it checks for some data. If the data is missing then it opens up a modal window with a form to get the missing data…

When I open that modal window in front of the main window, the main window still has the focus and is still movable.

(If I click inside the modal window the main window is not movable anymore)

I would like the modal window to open and get the focus and the main window should be frozen and not movable at all.

You have the Window Type set as Modal or Movable Modal and are using showmodal to show it?

Main window is document … yep, the other window is set to modal. Its strange that if i ooen the second window from a buttons action handler it works fine…

Your problem is likely that you are opening the modal window from the open event of your main window. Thus, the main window is not completed at the time the modal is opened. Set a Boolean flag in the open event of your main window if the data is missing. Then at the end of your open event, turn on a short period timer if the flag is True. Then have the timer show the modal window.