http://www.codeproject.com/KB/shell/OpenedFileFinder.aspx?fid=422864&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26&select=2277170
This article explains it pretty good.
It uses NtQuerySystemInformation to get the handles.
http://msdn.microsoft.com/en-us/library/ms724509(VS.85).aspx