Capturing Currently focussed Application & active Open File in that application

sk_bhosale

New member
Joined
Dec 13, 2007
Messages
2
Programming Experience
5-10
Is there a way to Capture Currently focussed Application & active Open File in that application.

I just want the file name which is opened in focussed application, it could be any document like pdf, excel, word, images.

I will need the active file name in that particular application, so that on a certain keystroke ( like 'F6' ), i will get the filename and run another application passed to it.

Ideally i would like to develop a VB application which will run in the background and look for a keystoke and run a vbs script passing the Full File Name ("c:\temp\book1.xls) to it.

Is it possible?



Thanks in advance.
 
Getting the current active window and process would be done using the Windows API. As for the "active open file" in that application, what does that even mean? Sure, many applications are used to display, and perhaps edit, the contents of a file or files, but it's not like there's some standard interface that all applications implement to indicate they have a file open. The way to do that would be different and specific for every application, not to mention that plenty of applications can have multiple files open at the same time. Think of what you could create yourself in VB. You could open many and varied files yourself. How would someone else's app determine the "active open file" in your app?
 
Active Open File means :

At any given time only one application has a focus (highligted).
Say if My focused application is Excel and it has 3 excel files open.
But only one file you can edit at a given point of time so i would like to know the that filename name.

any help is appreciated.

Thanks.
 
You seem to be assuming that every application will have some standard property that you could get to give you this information. If it's even possible, it would be different for every app, so you'd have to write specific code for every app you wanted to support.
 
Back
Top