As far as I know, ShellExecute doesn't return a handle to the opened process. It returns a number greater then 32 on success, 31 if no association exists, 0 if the system is out of memory or resources. ERROR_FILE_NOT_FOUND(2) if the file does not exist. ERROR_PATH_NOT_FOUND(3) if the path does not exist and ERROR_BAD_FORMAT(11) if the executable format is invalid. Possibly there are more of these, but these are the most common ones.