Prevent WinAPI Error Crash Program