P.S. When you use InstallPopup() to install a custom made popup, the user interface won't let you get to any other window until you call RemovePopup(), but your code doesn't wait: it keeps on running. If you want to wait for something to happen on your custom popup, you can call GetUserEvent as in the following statement:
waited4event = GetUserEvent(1, &waited4panel, &waited4control);
Look at the help in the function panel for GetUserEvent.
If you potentially will have a popup installed ontop of another popup, you may run into problems if you have callbacks on your custom popup panels. You may need to handle the event in code immediately following the GetUserEvent call. There, you'll need to check the panel and the control which generated the event to determ
ine what to do.
Click
here to see some help I got from Roberto Bozzolo