Ah, those were the days! I think I still have that Petzold book somewhere. It had to come with examples, because Stack Overflow didn't exist yet, so that was the only way you could get stuff working in a reasonable amount of time. (Except for when it didn't work in your code for some reason.)
I really like the article, but I'm not sure how else you're really going to do it. You could have magic functions that get called like in Qt (draw(), mousePress())* or that clunky Microsoft C++ framework whose name is escaping me (OnPaint(), OnMouseDown()), but behind the scenes the windowing systems is going have to have a big case statement of: in case repaint call repaint(); in case mouse down call mousePress(); etc. Win32's WndProc just made you write the case statement yourself instead of looking up the documentation to see which magic function you need to override.
I'm a JS framework hater--I've never used any, but I figure if they have a new one every year, and all the frameworky-looking websites are slow, there's got to be a better way--but if React is basically WndProc then at least it's on a solid foundation.
* React is generally considered to be "just" the view layer. You feed data in, and based on that data, return what the current output of a given component should be. It does include a per-component state feature, which can easily be sufficient state management for a smaller app.
* Redux is just state management. Put all the write logic into a single "reducer" function structure, and the only way to run any of that reducer logic is to call Redux's "dispatch" function with an object describing the action that took place (such as `{type : "ADD_TODO", text : "Buy Milk"}`. That's where the switch aspect usually comes in, similar to WndProc.
* There's "official" bindings to hook together React and Redux, but also bindings for a bunch of other view libraries as well (Vue, Angular, Mithril, Deku, etc), and all they really do is subscribe to Redux's state change callback and pass the new state along.
For what it's worth, my last year of learning React and Redux has already drastically changed how I think about programming. It's a great first step into functional programming and thinking about things in terms of state and output.
I really like the article, but I'm not sure how else you're really going to do it. You could have magic functions that get called like in Qt (draw(), mousePress())* or that clunky Microsoft C++ framework whose name is escaping me (OnPaint(), OnMouseDown()), but behind the scenes the windowing systems is going have to have a big case statement of: in case repaint call repaint(); in case mouse down call mousePress(); etc. Win32's WndProc just made you write the case statement yourself instead of looking up the documentation to see which magic function you need to override.
I'm a JS framework hater--I've never used any, but I figure if they have a new one every year, and all the frameworky-looking websites are slow, there's got to be a better way--but if React is basically WndProc then at least it's on a solid foundation.
I'm sure the names of these functions are wrong