-1

Bonjour,
Je suis entrain de développer une application en Csharp (console application), elle permet de détecter les fenetres ouvertes (celles de la barre de taches) et de donner leurs noms. Enfaite ce que je veux faire, c'est de détecter les chemins de ces fenetres, par exemple pour les fichiers word ouverts.
Autrement dit, si j'ai un fichier word sur mon bureau, je veux que le chemin soit: "C:\Documents and Settings\Administrator\Desktop\MonfichierWord.doc".
mais en utilisant:

GetWindowThreadProcessId(hwnd, out pid);
Process p = Process.GetProcessById(pid);
Console.WriteLine(p.MainModule.FileName);

elle me renvoit: "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"

Je sait pas comment faire, alors SVP, qq1 a une idée ??
Merci

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by PierlucSS
0

Hello,

I am currently developping an application in c# (console app). It is detecting the open windows (the ones population the taskbar) and it gives their name. Well, what I want to do is detect the path of these windows a good example would be word documents opened.

i.e.:
If i have a file on my desktop ( that is currently opened in word? ) I wan the path to be "C:\Documents and Settings\Administrator\Desktop\MonfichierWord.doc"
using:

GetWindowThreadProcessId(hwnd, out pid);
 Process p = Process.GetProcessById(pid);                            
 Console.WriteLine(p.MainModule.FileName);

it returns me "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"

I have no clue on how to do this, so please, anyone has an idea?

Thank you!:)

I translated :)

oh and by the way, the title of the thread would be:

"path of an opened word document"

Edited by PierlucSS: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.