But I would go to great lengths to avoid repeating such a mess...
The key is to not try and fit an object-oriented idea into a non-object-oriented language.
The typedefs are arranged the way they are to give some notion of inheritance to the reader... All handles are HANDLEs, an HWND is a "sub-type" of HANDLE, etc. Although it's pretty gross, there is some logic behind it.
Whilst their reasoning for not using C++ is valid, I think there's a lesson here for programmers even today.
Too many people use C because "C++ is too slow" or "I don't like C++" or even "I don't know C++" and come out with all this hacky and horrible C with typedefs all over the place to hide stuff. In C++ a HWND could easily be abstracted out in a different way - for instance, a pointer to a class Window, rather than a handle to a window. They try to fit OO programming into a non-OO language and make everything so much worse in the process.
I guess I should also mention that, at least for most Windows programming these days, you shouldn't need to even worry about this old API. It has thankfully been replaced by something much cleaner, and by something that's
really OO
