title: Get path to file currently open in Windows Picture & Fax viewer
body: <p>I am writing an "add-on" for Windows Picture viewer that will need to send commands to it (like "Show next/previous image") and obtain file path to currently selected image. I managed to implement sending commands via SendMessage, but I don't know how to request info from a process. Is this possible?
  So far I can only extract filename from window title, but this restricts usage to just one folder, I need the full path.</p>
  
  <p>[EDIT] I did some search and found, that there's (undocumented?) possibility to find list of all handles used by process, using function <strong>NTQuerySystemInformation</strong> (As seen here <a href="https://stackoverflow.com/questions/1575286/delphi-get-what-files-are-opened-by-an-application">Delphi - get what files are opened by an application</a>). 
  The problem is, however, that the example provided there doesn't show file handles for me at all (only non-harddrive device handles), and while I found working example here <a href="http://www.codeguru.com/Cpp/W-P/system/processesmodules/article.php/c2827/" rel="nofollow noreferrer">http://www.codeguru.com/Cpp/W-P/system/processesmodules/article.php/c2827/</a>, seems like Picture Viewer doesn't hold any handle to previewed file when launched from explorer. </p>