<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Window API for know what file is opened through a Window?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Window API for know what file is opened through a Window?' posted on the 'Windows programming' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2009 Programmers Heaven</copyright>
    <pubDate>Sat, 21 Nov 2009 11:58:28 -0700</pubDate>
    <lastBuildDate>Sat, 21 Nov 2009 11:58:28 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Window API for know what file is opened through a Window?</title>
      <link>http://www.programmersheaven.com/mb/windows/393418/393418/window-api-for-know-what-file-is-opened-through-a-window/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I've a windows xp and sp3.&lt;br /&gt;
&lt;br /&gt;
I know a complete path of a file. How can I check if the file is opened?&lt;br /&gt;
&lt;br /&gt;
The applications that could open this file is either Notepad, Wordpad or textpad.&lt;br /&gt;
&lt;br /&gt;
It could be so that there would be multiple instances of that application opening the same file at some time.&lt;br /&gt;
&lt;br /&gt;
In any case, I would like to close this file and close the associated application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have the following strategies in my mind for checking if the file is open and is opened by some application:&lt;br /&gt;
&lt;br /&gt;
1. Know what all windows are currently opened. Iterate on each of these window to know which are the ones that have opened that file.&lt;br /&gt;
&lt;br /&gt;
Unfortuately, I do not know any Window API for finding which file is opened in that window?&lt;br /&gt;
&lt;br /&gt;
2. The other approach would be get all the running processes in the system. Iterate on all of them to find what there command line parameters are. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please help. &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/windows/393418/393418/window-api-for-know-what-file-is-opened-through-a-window/</guid>
      <pubDate>Tue, 07 Jul 2009 11:53:14 -0700</pubDate>
      <category>Windows programming</category>
    </item>
    <item>
      <title>Re: Window API for know what file is opened through a Window?</title>
      <link>http://www.programmersheaven.com/mb/windows/393418/393420/re-window-api-for-know-what-file-is-opened-through-a-window/#393420</link>
      <description>It's a Win32 FAQ (PID =&amp;gt; File Handle)&lt;br /&gt;
See on &lt;a href="http://tinyurl.com/cmhb5g"&gt;Win32 ng &lt;/a&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/windows/393418/393420/re-window-api-for-know-what-file-is-opened-through-a-window/#393420</guid>
      <pubDate>Tue, 07 Jul 2009 13:28:12 -0700</pubDate>
      <category>Windows programming</category>
    </item>
  </channel>
</rss>