Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine the program used to open a file.

Status
Not open for further replies.

tmcnutt

Programmer
May 17, 2002
83
0
0
US
I want to know what application on a client's machine is used to open a file. For example, .dwg file could be opened with AutoCAD or VoloView so I need know what is the default file association. I need to open the program and I want to determine if the program is opened already. I currently use the process.start method to open a file, but it starts a new copy of the program if one is already running. I want to open the file as an additional file within the program instead of starting a new program.

Thanks,
Tom
 
You can use SendKeys or APIs to the application.

To determine if the needed application is already up and running, use APIs again. The real problem is knowing whether the application is running as part of your application vs having been started for some other purpose -- the user can start any application at any time.

__________________________________________
Try forum1391 for lively discussions
 
I am just getting into a similar applicatiion and would appreciate a copy of the code.

Thanks in advance,
Pat
 
That sort of thing works best with full automation. This means that yuou need to know in advance which applications you will be handling; and especially whether you can automate them.

When you can automate the application, you will need to develop a user interface. This means that the user will interact with the application only through your UI.

The above is the best scenario I can think of. Trying to interact, at run time, with an unknown application is not something I would recommend.

Everything will of course hinge on the requirements of your project and the amount of development time you can invest in it.

__________________________________________
Try forum1391 for lively discussions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top