Getting the full path of current active file (not a Java application, e.g. pdf) in Java
<p>(Active - the file whose window is in the foreground.)</p>

<p>I am working on a problem which is to extract the text in the current active pdf (.pdf), word (.doc, .docx), or notebook (.txt) file in real time. I have tried JNA, and got the active file name (e.g., a.pdf) and exe name, but not the file path (e.g., C:/Desktop/.../a.pdf.) I need the full file path here, because I can read the corresponding file and extract the text in it once I know its path. (I do not need the exe path, e.g., C:/Program Files/adobe.exe.)</p>

<p>I have checked the doc of JNA, but not found a method which can provide the path of current active file (not a Java application). </p>

<p>Alternatively, I think maybe some package can provide the full path of the current file/icon in focus (e.g., I click a.pdf before I open it and my mouse will focus on a.pdf.) I tried JNI, but still not found such a method.</p>

<p>Could you please provide some suggestions about how to get the path of the current active file (not a Java application) using Java or how to get the path of the current file/icon in mouse focus?</p>

<p>Thanks a lot!</p>
