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 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