Link to home
Start Free TrialLog in
Avatar of bubbles
bubbles

asked on

Better Shell Function

I need to be able to shell and application, file shortcut etc. from my application. The RUN command on the START menu can do this, so I figure there must be a suitable API call. I have found lots of them, but they all do slightly different things. I need to be able to shell a file as if I had just double clicked on it. Can someone show me some code to do this???
Avatar of chrisbolt
chrisbolt

Avatar of bubbles

ASKER

This is a good answer, but there are a couple of problems. I had actually already written code to do this. Anyway, this code cannot shell .lnk files (shortcuts). The other problem is that I need to be able to open a file using it's default action. E.g., if I make the filename a .wav file, I will want the function to Play it, not Open it, but I don't want my program to have to work out which action to perform. Maybe there is a constant to do this. I basically want something that will behave in the same way as the Run command on the Start menu.
ASKER CERTIFIED SOLUTION
Avatar of chrisbolt
chrisbolt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bubbles

ASKER

Sorry, but I actually got your previous answer to work. I had to play around with a few things. Anyway, sorry that I rejected your answer. Also, I have an identical question posted (something went wrong when I submited it) so if you answer that as well, you can have both lots of points. The question number is Q.10093842