FindExecutable

  HANDLE FindExecutable(lpszFile, lpszDir, lpszResult)    
  LPSTR lpszFile; /* pointer to string for filename */
  LPSTR lpszDir; /* pointer to string for default directory */
  LPSTR lpszResult; /* pointer to string for executable file on return */

The FindExecutable function retrieves the name and handle of the executable file that is associated with a specified filename.

Parameters

lpszFile

Points to a null-terminated string specifying a filename. This can be a document or executable file.

lpszDir

Points to a null-terminated string specifying the default directory.

lpszResult

Points to a buffer that receives a filename when the function returns. This filename is a null-terminated string specifying the executable file that is started when an “open” association is run on the file specified in the lpszFile parameter.

Return Value

The return value is the instance handle of the executable file that is associated with the specified filename if function is successful. (This handle could also be the handle of a DDE server application.) If the return value is less than or equal to 32, it specifies an error code.

Comments

When FindExecutable returns, the lpszResult parameter may contain the path to the DDE server that is started if no server responds to a request to initiate a DDE conversation.

See Also

ShellExecute