No. MSDN says ::GetLastError() returns better error codes for ::ShellExecuteEx(). This switch statement *probably* came from the times when we still used ::ShellExecute() which did not use ::GetLastError().