Collision detection

I'm working on a screen saver using a simple collision detection routine using
Winprocs.IntersectRect,  and it's almost but not quite what I need.  I need to
not only know whether there is a collision, but what side of the rectangles
were impacted.  Does anybody have any suggestions on how to accomplish this?