To obtain information about the application that is launched as a result of calling ShellExecute, use ShellExecuteEx.
WINSHELLAPI BOOL WINAPI ShellExecuteEx(
Performs an action on a file.
Returns a nonzero value if successful, or zero otherwise. To get extended error information, call theGetLastError function.
Address of a SHELLEXECUTEINFO structure that contains and receives information about the application being executed.
If the function succeeds, it sets the hInstApp member of the SHELLEXECUTEINFO structure to the instance handle to the application that the function started. If the function fails, hInstApp is one of the SE_ERR_ error values indicating the cause of the failure. (An instance handle will always be greater than 32 and an error value less than 32.) Note that the SE_ERR_ error values are for compatibility with the ShellExecute function; use theGetLastError function to retrieve error information.