The boundary element method is applied to investigate the optical forces when whispering gallery modes (WGMs) are excited by a total internally reflected wave. Such evanescent wave is particularly effective in exciting the high-$Q$ WGM, while the low angular or high radial order modes are suppressed relatively. This results in a large contrast between the forces on and off resonance, and thus allows for high size-selectivity. We fully incorporate the prism-particle interaction and found that the optical force behaves differently at different separations. Optimal separation is found which corresponds to a compromise between intensity and $Q$ factor.