Windows/Explorer will change a process to the "Not responding" state when it goes too long without processing any messages.
In VB6, this will happen when running a long section of code without calling DoEvents
.
Unfortunately, VB6 doesn't easily do multiple threads so you're best option is to periodically call DoEvents
during the operation. Ideally, this would be just after updating the progress bar position.
When doing this, you will need to be careful to protect against re-entrancy. This is easy enough by disabling the controls when the long operation starts and re enabling them when it's finished.
If you want to let them cancel, you will need to use a boolean value that you set in the cancel button click event and check after calling DoEvents
.