I think there are two parts here. If PROPSHEET_SetCurSel() fails in WM_INITDIALOG we could probably check for that and use EndDialog() or something like that. DestroyWindow does not look right in this context. It's too complicated to tell right away what's best, for example PROPSHEET_CreatePage() failing calls PROPSHEET_RemovePage() which at the very least is counterintuitive - why remove something that we couldn't create. The other question is if PROPSHEET_SetCurSel() should be able to destroy the whole thing to begin with.
To me it looks like one of those changes that could require some rework and manual testing of what we already have. Checking just IsWindow() on some value that we know is not always a window handle looks like a quick fix.