V2:
- Don't call `SetLastError()` unnecessarily. - Return `E_FAIL` by default from `uia_get_hr_for_last_error()` instead of `HRESULT_FROM_WIN32`. - Return `UIA_E_ELEMENTNOTAVAILABLE` when `GetWindowThreadProcessId` fails, since it will only fail on an invalid window handle.