I would like to bring this up again to clear something up.
I believe the misconception stems from the meaning of the "MS Shell Dlg 2" pseudo font. You will easily see that *no* Windows dialog uses this font at 9pt, neither does 99 % of Windows software made in the last 15 years.
The de-facto standards that are used in Windows are:
(1) 9pt Segoe UI - for Menus, Title bars and list-like items (including the Windows Explorer file and folder names), and sometimes combo boxes and explanatory text; and
(2) 8pt (more precisely: 8.25pt) Microsoft Sans Serif (not to be confused with MS Sans Serif) - for text boxes, buttons, tab controls, explanatory text (most of the time), and pretty much everything else.
(1) comes from the current users' appearance preferences. I am referring to this dialog:
https://media.askvg.com/articles/images6/Advanced_Appearance_Settings_Windows.png
One way to retrieve these settings is:
NONCLIENTMETRICSW metrics = { 0 };
metrics.cbSize = sizeof(metrics);
SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &metrics, 0);
Note that 8pt Microsoft Sans Serif appears nowhere in NONCLIENTMETRICS. The widespread usage of 8pt Microsoft Sans Serif stems from it being the default setting .NET Windows Forms as well as Win32 and MFC applications (i.e. if you do not specifcy any other font). It comes from the mapping of "MS Shell Dlg" (without "2").
This font is retrieved using:
HGDIOBJ default_gui_font = GetStockObject(DEFAULT_GUI_FONT);
and optionally:
LOGFONTW default_gui_font_info = { 0 };
GetObjectW(default_gui_font, sizeof(default_gui_font_info), &default_gui_font_info);
This is also what SystemFonts.DefaultFont does in .NET. Microsoft Sans Serif 8pt is a bit weird, admittedly, because neither does not appear as a configurable preference in the "appearance" dialog, nor is it listed in any design guidelines. That doesn't change the fact that it is used in most .NET programs, as well as many Windows dialogs (alongside Segoe UI 9pt).
Note that the MSDN pages for these (and many related) functions list "Tahoma" as the default font. *This information is completely outdated since at least Windows Vista*, but these functions are old, and so is their documentation.
At any rate, whether you choose the "MessageFont" from NONCLIENTMETRICS, or the DEFAULT_GUI_FONT, or "MS Shell Dlg", or "MS Shell Dlg 2": Use the *entire* font. Do *not* just use the font family and slap a different font size on it from a misinterpreted guideline.