Since your using 2009 now switch to TShellExecuteInfo(more commonly known as TShellExecuteInfoW), with PChars(PWideChars). With the error you provided I'm guessing that the file you wanted to open has no application registered with it. If it's an exe file.
Also, according to http://msdn.microsoft.com/
Main Topics
Browse All Topics





by: JohnjcesPosted on 2009-09-24 at 08:02:57ID: 25414070
One of the first things I noted was lpDirectory was missing and that "could" affect how D2009 tries to find the file. An entire string with path and all in lpFile "should" work.
I use the class TShellExecuteIInfo and not the TSHellExecuteInfoA which has smoe subtle differences.
Try just the file name and in lpFile and put the full path in lpDirectory and see what happens. Maybe change your class too.
Hope this helps... just my .02 cents!
John