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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I open a file with the "Open with" dialog 1

Status
Not open for further replies.

psnead

Programmer
Jul 5, 2000
41
DK
I am opening a file from a windows program. I can open the
file with ShellExecute, but I don't want to specify the type of file, it will be more portable this way. Anyone know how to call the "Open with" dialog that is used in windows so much. I figure it must be an MFC call, but maybe not...
 
You can use ShellExecute, but don't pass directly name of file that you want to open as parameter for ShellExecute. Instead of that, use the following string:
C:\WINDOWS\rundll32.exe shell32.dll,OpenAs_RunDLL FILENAME

You type name of file that you want to open in place of FILENAME in above parameter.

Good luck !

PS. Any further question, contact me:
quangdaotran@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top