← Back to context

Comment by pjc50

6 years ago

Ah, the classic approach from WinProc() upwards. While I think it might be useful to work through this once, since then you understand what a message loop is and how it dispatches to controls, but for almost all practical purposes if you want to build a classic app it's easier to do it in C++ with MFC/ATL. Or even C#/Winforms.

I note this version uses LPSTR rather than LPTSTR; perhaps it predates the UNICODE fiasco and the brief window where UCS-2 seemed like a good idea.

Note that if you decide to use MFC you still need to know Win32. A common misconception and source of frustration about MFC is that it is a layer over Win32 or that it somehow replaces it, which is not the case and if you (royal you here) expect that you'll be disappointed. MFC is a helper framework build with Win32 and C++ to ease some bits of making a Windows application, but even for the most basic stuff you are still dealing with Win32. It isn't a "Win32" or "MFC" situation, it is a "just Win32" or "Win32 and MFC" situation. If you don't like Win32 or feel it is too hard, chances are MFC wont change your opinion either (though you can like Win32 and dislike MFC - after all it has been left to rot).

I have done quite a bit of Win32 in my life and I think even to this day this knowledge helps me diagnose issues with UI performance of browsers and other applications.