Link to home
Start Free TrialLog in
Avatar of sharons
sharons

asked on

Show Modal form without stopping the program

I have an application in which there are several forms. One of them is a mail client to receive pop3 mail messages. My problem occurs when the messages are downloading, I like to let the user go to other forms. Some of these forms have modal dialogs. When one of these dialogs is opened, the download stops. What can I do to prevent that, threads maybe ? any example ?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sharons
sharons

ASKER

Thank you Madshi.

What do you think about the following:

I have my main application. I call the method that downloads the email messages from within a separate thread. While the separate thread downloads the messages, the main application calls show modal.  Would the download be stoped then ?  Thank you.
sharons,

ok, variant number (4).   :-)

But be cautious with what you do in this thread, because (as I said before) the VCL is not reentrant (is it written this way?).
So changes in your download form (e.g. a progress bar) should be made with the thread.synchronize method.

Regards, Madshi.

P.S: Did you really understand my loooooooong garbage?
Avatar of sharons

ASKER

Thank you for your time. I have decided to limit the navigation while download occur.  I think it will be safer like that. The download functions are parts of components which I did not write myself. I prefer not to change them as a new release is coming up soon.