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

Simulate OpenWith

Status
Not open for further replies.

Horrid

Programmer
May 20, 1999
373
I am trying to simulate an open as dialog(like the one you get when you right click a file in Explorer) but just can't get it.

I played about with ::ShellExecute(NULL, NULL, "RUNDLL32.EXE", "shell32.dll,OpenAs_RunDLL " ,NULL, SW_SHOWNORMAL); but I have 2 problems with that. First is it brings up the first "search the web or choose yourself menu" that I don't want, and I have no idea how to get the selected application from it.

My other solution has been to search through the "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths" key in the reg. This works well, gets me all the known installed apps, I then rip the icons from the exe. Problem comes with finding what the application name is, I have its path and exe but not the program name. I can get program name from the uninstall list but not from the path. As the app is intended to be very easy to use I can't expect the end user to look at the full exe name and know what it is. Any hints on this one? Am I just not aware of the correct reg keys to use or is there an api call I should use? Maybe its possible to get the class id from the uninstall and search backwards on that till I find the exe path? So far this solution hasn't worked.

Thanks for any help
 
I don't quite get what you are trying to do but why do you need to create your own file dialog?

You can just use the CFileDialog if what you are trying to do is to create Open/SaveAs dialog.
 
I need to associate an action with an application, much like the shortcut buttons on the newer keyboards. It needs to be super easy so I want to show just a list of installed applications that then can associate with that action.

eg I push the web/home button for the first time, my app says "hey, I have no association for that, choose from this list" and I show them a list of all installed apps (and a browse just in case my list misses one).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top