I'm not sure of what the best way to do it, but I've read this article on delphi.about.com which might answer your last post

http://delphi.about.com/library/weekly/aa112602a.htm

I haven't gotten as far as to test it yet though :twisted: