This code is now moved to GetPendingFilesToOpen.