How could I create similar structure to handle Win32 Messages like it is in MFC?
In MFC;
BEGIN_MESSAGE_MAP(CSkinCtrlTestDlg, CDialog)
//{{AFX_MSG
The MFC message map doesn't use a regular WndProc per se. IIRC, it is based on some kind of hook mechanism.
However, I guess it shouldn't be very hard to adapt the macros to an usual WndProc.
The 1st approach that comes to mind is to let the macros create an array of Message id/Handler function pairs. Even better: Use a map for improved performance.
Your WndProc would loop through that array to identify the given WM and execute the corresponding handler.
You might also want the BEGIN_MESSAGE_MAP macros to mimic a switch statement where each ON_BLAH() line would be a case line inside the switch().
That should be too hard.