Saurabh Lalwani
Saurabh Lalwani

Reputation: 715

Get Filename of the Current Active Window

I am trying to get the filename of a word document or any other window for that matter while some dialog box like Save as or Open or Print etc. is open. Can anybody give me an example of how to implement this in C#.

Upvotes: 1

Views: 541

Answers (1)

mjv
mjv

Reputation: 75298

Windows API can give you the name of the application which occupies a particular window, but to know what file (or files) are open within that application would require OLE automation or some other API supplied by the application (here winword.exe) itself.

Upvotes: 2

Related Questions