Add error handling for ChangeWindowAttributes