I suggest to introduce a third thread for better separation of the tasks "GUI drawing" and "defragmentation API calls".
Hummmm... I don't know about that one. It's been my experiance that when you have a thredding problem adding more threads never fixes the problem. All you end up with is more threads and more posibilities as to what could be going wrong. And you still have to fix the original problem.
True, By chance you could move things around a bit so the problem doesn't manifest it's self that often. But really that's just putting things off until faster computers, more cores, or OS changes brings the problem back to the for-frount.
I'm not agenst more threads. Just let's fix the problem before we make it more complicated.
Besides. I don't mean to say anything bad about the main developer because we are all there in one way of another, none of us can clame to know everyting.. But it seems more of a learning the quirky windows Threading issue then anything else. More threads will not help that.
Doing process control I end up doing threading all the time. The main program HUGE and has upwards of 100 threads running. It's always a pain. Luckly for me I don't have to deal with the windows GUI. So I tip my hat to one who gives it a go.