WinProc programming was indeed pretty horrible. Didn't really program a lot in WinProc - but I've cut my teeth with MFC which was supposed to make it better.
They broke down the big switch in the program and created classes (the c in MFC) and macros.
The VCL of Borland was more abstracted, but we've used MFC.
I am pretty happy that I don't have to do this any more.
When I started with C# and Windows Forms it seemed like a revelation for me.
Have you seen Facebook's Flux/Dispatcher framework, for example? The Dispatcher is usually a massive switch statement that takes a single argument, which will be a record field that corresponds with the event type. It's exactly like switching on uMsg and then casting lParam to the relevant struct. And this is considered one of the absolute best web frameworks available right now.
On the bright side, I suppose we can look forward to equivalents of message crackers, OWL, and MFC for React soon enough.
Somehow it also says something, whatever the underlying structure, local and native VS remote and abstracted (dom/js), some patterns keeps coming back over and over.
Stores have the switch, and you're supposed to break those up along model lines. In most the apps I've written, they never get beyond 4 or 5 branches.
However in MFC's defense I think one can blame it on Microsoft's study group. I read somewhere that the Afx prefix came from their original design. A framework close in spirit to OWL, but their study group deemed it to high level.
So they made it a thin wrapper over Win16 instead.
On my case, the few cases I was forced outside OWL and MFC into pure C land, I use a set of macros from the Windows SDK.
They weren't properly documented, but with the Windows 3.1 SDK Microsoft created a kind of "type safe" handles and message dispatch macros, which relieved the WndProc pain.
Nevertheless, Xlib was even worse.
In my opinion the biggest obstacles for MFC were: * a pretty bad C++ compiler (the first good MS C++ compiler was the one with Visual Studio 2003 as much as i remember) * that the core group were "old school" C guys that either couldn't design a better object oriented system or thought that it would be to hard for the "normal" developers
The macros in the Windows 3.1 SDK were the strict header mode and message crackers.
https://support.microsoft.com/en-us/kb/83456
It made my life sane every time I had to use C instead of C++, and yet very few people knew about them.
Petzold never mentioned them in his books, I discovered them by chance in another book.
Nice to know that the Afx story might have not been a rumour, since other people heard the same.
My first Visual C++ was v5.0, by then it was already clear that Borland was on they way out as first choice. Sadly.
Some interesting constructs / keywords, eg.
And some insights: And design approaches: