The problem is (probably, without seeing your code it is mostly guesswork) that your button handler does not finish as quickly as possible - so the UI task does not get to do anything such as respond to a mouse event until it has. Your only real option there is to use a thread and move the processing code out of the UI completely. You could probably do this quite easily with a
BackgroundWorker[
^] - the link includes an example of starting and cancelling a thread.