I developed application that gets about 5000 records from a database and then i have to process the list to count unique entries.

It takes too long for the processing and the application looks as if it is hung, but eventually the processing is done.
Is there any way i can add Ajax like animation at the center of GUI (of application) to include the AJAX icon thats looks like a animated circle that rotates like a fan? and also give the ability to stop , include a stop button with in that animation or ESC to quit?

I know i have to include a background worker thread so that the application doesn't look like its hung and the processing is done in the background. But i can use this cool animation in mean time if any one can point me in right direction.