<PackageReference Include="System.Drawing.Common" Version="10.0.0-rc.2.25502.107" />

MessageId

struct MessageId
Simple internal wrapper that enables showing the message identifier string in the debugger.
using System.Runtime.CompilerServices; namespace Windows.Win32 { internal readonly struct MessageId { private readonly uint _id; public const uint WM_REFLECT = 8192; public const uint WM_REFLECT_NOTIFY = 8270; public const uint WM_REFLECT_NOTIFYFORMAT = 8277; public const uint WM_REFLECT_COMMAND = 8465; public const uint WM_REFLECT_CHARTOITEM = 8239; public const uint WM_REFLECT_VKEYTOITEM = 8238; public const uint WM_REFLECT_DRAWITEM = 8235; public const uint WM_REFLECT_MEASUREITEM = 8236; public const uint WM_REFLECT_HSCROLL = 8468; public const uint WM_REFLECT_VSCROLL = 8469; public const uint WM_REFLECT_CTLCOLOR = 8217; public const uint WM_REFLECT_CTLCOLORBTN = 8501; public const uint WM_REFLECT_CTLCOLORDLG = 8502; public const uint WM_REFLECT_CTLCOLORMSGBOX = 8498; public const uint WM_REFLECT_CTLCOLORSCROLLBAR = 8503; public const uint WM_REFLECT_CTLCOLOREDIT = 8499; public const uint WM_REFLECT_CTLCOLORLISTBOX = 8500; public const uint WM_REFLECT_CTLCOLORSTATIC = 8504; private MessageId(uint id) { _id = id; } public static explicit operator int(MessageId id) { return (int)id._id; } public static explicit operator MessageId(int id) { return new MessageId((uint)id); } public static implicit operator uint(MessageId id) { return id._id; } public static implicit operator MessageId(uint id) { return new MessageId(id); } [NullableContext(1)] public override string ToString() { object text = MessageIdToString(); if (text == null) { DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 2); defaultInterpolatedStringHandler.AppendLiteral("Id: "); defaultInterpolatedStringHandler.AppendFormatted(_id); defaultInterpolatedStringHandler.AppendLiteral(" (0x"); defaultInterpolatedStringHandler.AppendFormatted(_id, "X8"); defaultInterpolatedStringHandler.AppendLiteral(")"); text = defaultInterpolatedStringHandler.ToStringAndClear(); } return (string)text; } [NullableContext(2)] internal string MessageIdToString() { string text; switch (_id) { case 0: text = "WM_NULL"; break; case 1: text = "WM_CREATE"; break; case 2: text = "WM_DESTROY"; break; case 3: text = "WM_MOVE"; break; case 5: text = "WM_SIZE"; break; case 6: text = "WM_ACTIVATE"; break; case 7: text = "WM_SETFOCUS"; break; case 8: text = "WM_KILLFOCUS"; break; case 10: text = "WM_ENABLE"; break; case 11: text = "WM_SETREDRAW"; break; case 12: text = "WM_SETTEXT"; break; case 13: text = "WM_GETTEXT"; break; case 14: text = "WM_GETTEXTLENGTH"; break; case 15: text = "WM_PAINT"; break; case 16: text = "WM_CLOSE"; break; case 17: text = "WM_QUERYENDSESSION"; break; case 18: text = "WM_QUIT"; break; case 19: text = "WM_QUERYOPEN"; break; case 20: text = "WM_ERASEBKGND"; break; case 21: text = "WM_SYSCOLORCHANGE"; break; case 22: text = "WM_ENDSESSION"; break; case 24: text = "WM_SHOWWINDOW"; break; case 26: text = "WM_WININICHANGE"; break; case 27: text = "WM_DEVMODECHANGE"; break; case 28: text = "WM_ACTIVATEAPP"; break; case 29: text = "WM_FONTCHANGE"; break; case 30: text = "WM_TIMECHANGE"; break; case 31: text = "WM_CANCELMODE"; break; case 32: text = "WM_SETCURSOR"; break; case 33: text = "WM_MOUSEACTIVATE"; break; case 34: text = "WM_CHILDACTIVATE"; break; case 35: text = "WM_QUEUESYNC"; break; case 36: text = "WM_GETMINMAXINFO"; break; case 38: text = "WM_PAINTICON"; break; case 39: text = "WM_ICONERASEBKGND"; break; case 40: text = "WM_NEXTDLGCTL"; break; case 42: text = "WM_SPOOLERSTATUS"; break; case 43: text = "WM_DRAWITEM"; break; case 44: text = "WM_MEASUREITEM"; break; case 45: text = "WM_DELETEITEM"; break; case 46: text = "WM_VKEYTOITEM"; break; case 47: text = "WM_CHARTOITEM"; break; case 48: text = "WM_SETFONT"; break; case 49: text = "WM_GETFONT"; break; case 50: text = "WM_SETHOTKEY"; break; case 51: text = "WM_GETHOTKEY"; break; case 55: text = "WM_QUERYDRAGICON"; break; case 57: text = "WM_COMPAREITEM"; break; case 61: text = "WM_GETOBJECT"; break; case 65: text = "WM_COMPACTING"; break; case 68: text = "WM_COMMNOTIFY"; break; case 70: text = "WM_WINDOWPOSCHANGING"; break; case 71: text = "WM_WINDOWPOSCHANGED"; break; case 72: text = "WM_POWER"; break; case 74: text = "WM_COPYDATA"; break; case 75: text = "WM_CANCELJOURNAL"; break; case 78: text = "WM_NOTIFY"; break; case 80: text = "WM_INPUTLANGCHANGEREQUEST"; break; case 81: text = "WM_INPUTLANGCHANGE"; break; case 82: text = "WM_TCARD"; break; case 83: text = "WM_HELP"; break; case 84: text = "WM_USERCHANGED"; break; case 85: text = "WM_NOTIFYFORMAT"; break; case 123: text = "WM_CONTEXTMENU"; break; case 124: text = "WM_STYLECHANGING"; break; case 125: text = "WM_STYLECHANGED"; break; case 126: text = "WM_DISPLAYCHANGE"; break; case 127: text = "WM_GETICON"; break; case 128: text = "WM_SETICON"; break; case 129: text = "WM_NCCREATE"; break; case 130: text = "WM_NCDESTROY"; break; case 131: text = "WM_NCCALCSIZE"; break; case 132: text = "WM_NCHITTEST"; break; case 133: text = "WM_NCPAINT"; break; case 134: text = "WM_NCACTIVATE"; break; case 135: text = "WM_GETDLGCODE"; break; case 160: text = "WM_NCMOUSEMOVE"; break; case 161: text = "WM_NCLBUTTONDOWN"; break; case 162: text = "WM_NCLBUTTONUP"; break; case 163: text = "WM_NCLBUTTONDBLCLK"; break; case 164: text = "WM_NCRBUTTONDOWN"; break; case 165: text = "WM_NCRBUTTONUP"; break; case 166: text = "WM_NCRBUTTONDBLCLK"; break; case 167: text = "WM_NCMBUTTONDOWN"; break; case 168: text = "WM_NCMBUTTONUP"; break; case 169: text = "WM_NCMBUTTONDBLCLK"; break; case 256: text = "WM_KEYDOWN"; break; case 257: text = "WM_KEYUP"; break; case 258: text = "WM_CHAR"; break; case 259: text = "WM_DEADCHAR"; break; case 260: text = "WM_SYSKEYDOWN"; break; case 261: text = "WM_SYSKEYUP"; break; case 262: text = "WM_SYSCHAR"; break; case 263: text = "WM_SYSDEADCHAR"; break; case 265: text = "WM_KEYLAST"; break; case 269: text = "WM_IME_STARTCOMPOSITION"; break; case 270: text = "WM_IME_ENDCOMPOSITION"; break; case 271: text = "WM_IME_COMPOSITION"; break; case 272: text = "WM_INITDIALOG"; break; case 273: text = "WM_COMMAND"; break; case 274: text = "WM_SYSCOMMAND"; break; case 275: text = "WM_TIMER"; break; case 276: text = "WM_HSCROLL"; break; case 277: text = "WM_VSCROLL"; break; case 278: text = "WM_INITMENU"; break; case 279: text = "WM_INITMENUPOPUP"; break; case 287: text = "WM_MENUSELECT"; break; case 288: text = "WM_MENUCHAR"; break; case 289: text = "WM_ENTERIDLE"; break; case 306: text = "WM_CTLCOLORMSGBOX"; break; case 307: text = "WM_CTLCOLOREDIT"; break; case 308: text = "WM_CTLCOLORLISTBOX"; break; case 309: text = "WM_CTLCOLORBTN"; break; case 310: text = "WM_CTLCOLORDLG"; break; case 311: text = "WM_CTLCOLORSCROLLBAR"; break; case 312: text = "WM_CTLCOLORSTATIC"; break; case 512: text = "WM_MOUSEMOVE"; break; case 513: text = "WM_LBUTTONDOWN"; break; case 514: text = "WM_LBUTTONUP"; break; case 515: text = "WM_LBUTTONDBLCLK"; break; case 516: text = "WM_RBUTTONDOWN"; break; case 517: text = "WM_RBUTTONUP"; break; case 518: text = "WM_RBUTTONDBLCLK"; break; case 519: text = "WM_MBUTTONDOWN"; break; case 520: text = "WM_MBUTTONUP"; break; case 521: text = "WM_MBUTTONDBLCLK"; break; case 522: text = "WM_MOUSEWHEEL"; break; case 528: text = "WM_PARENTNOTIFY"; break; case 529: text = "WM_ENTERMENULOOP"; break; case 530: text = "WM_EXITMENULOOP"; break; case 531: text = "WM_NEXTMENU"; break; case 532: text = "WM_SIZING"; break; case 533: text = "WM_CAPTURECHANGED"; break; case 534: text = "WM_MOVING"; break; case 536: text = "WM_POWERBROADCAST"; break; case 537: text = "WM_DEVICECHANGE"; break; case 641: text = "WM_IME_SETCONTEXT"; break; case 642: text = "WM_IME_NOTIFY"; break; case 643: text = "WM_IME_CONTROL"; break; case 644: text = "WM_IME_COMPOSITIONFULL"; break; case 645: text = "WM_IME_SELECT"; break; case 646: text = "WM_IME_CHAR"; break; case 656: text = "WM_IME_KEYDOWN"; break; case 657: text = "WM_IME_KEYUP"; break; case 544: text = "WM_MDICREATE"; break; case 545: text = "WM_MDIDESTROY"; break; case 546: text = "WM_MDIACTIVATE"; break; case 547: text = "WM_MDIRESTORE"; break; case 548: text = "WM_MDINEXT"; break; case 549: text = "WM_MDIMAXIMIZE"; break; case 550: text = "WM_MDITILE"; break; case 551: text = "WM_MDICASCADE"; break; case 552: text = "WM_MDIICONARRANGE"; break; case 553: text = "WM_MDIGETACTIVE"; break; case 560: text = "WM_MDISETMENU"; break; case 561: text = "WM_ENTERSIZEMOVE"; break; case 562: text = "WM_EXITSIZEMOVE"; break; case 563: text = "WM_DROPFILES"; break; case 564: text = "WM_MDIREFRESHMENU"; break; case 673: text = "WM_MOUSEHOVER"; break; case 675: text = "WM_MOUSELEAVE"; break; case 768: text = "WM_CUT"; break; case 769: text = "WM_COPY"; break; case 770: text = "WM_PASTE"; break; case 771: text = "WM_CLEAR"; break; case 772: text = "WM_UNDO"; break; case 773: text = "WM_RENDERFORMAT"; break; case 774: text = "WM_RENDERALLFORMATS"; break; case 775: text = "WM_DESTROYCLIPBOARD"; break; case 776: text = "WM_DRAWCLIPBOARD"; break; case 777: text = "WM_PAINTCLIPBOARD"; break; case 778: text = "WM_VSCROLLCLIPBOARD"; break; case 779: text = "WM_SIZECLIPBOARD"; break; case 780: text = "WM_ASKCBFORMATNAME"; break; case 781: text = "WM_CHANGECBCHAIN"; break; case 782: text = "WM_HSCROLLCLIPBOARD"; break; case 783: text = "WM_QUERYNEWPALETTE"; break; case 784: text = "WM_PALETTEISCHANGING"; break; case 785: text = "WM_PALETTECHANGED"; break; case 786: text = "WM_HOTKEY"; break; case 791: text = "WM_PRINT"; break; case 792: text = "WM_PRINTCLIENT"; break; case 856: text = "WM_HANDHELDFIRST"; break; case 863: text = "WM_HANDHELDLAST"; break; case 864: text = "WM_AFXFIRST"; break; case 895: text = "WM_AFXLAST"; break; case 896: text = "WM_PENWINFIRST"; break; case 911: text = "WM_PENWINLAST"; break; case 32768: text = "WM_APP"; break; case 1024: text = "WM_USER"; break; case 25: text = "WM_CTLCOLOR"; break; case 213: text = "EM_GETLIMITTEXT"; break; case 214: text = "EM_POSFROMCHAR"; break; case 215: text = "EM_CHARFROMPOS"; break; case 183: text = "EM_SCROLLCARET"; break; case 1074: text = "EM_CANPASTE"; break; case 1075: text = "EM_DISPLAYBAND"; break; case 1076: text = "EM_EXGETSEL"; break; case 1077: text = "EM_EXLIMITTEXT"; break; case 1078: text = "EM_EXLINEFROMCHAR"; break; case 1079: text = "EM_EXSETSEL"; break; case 1080: text = "EM_FINDTEXT"; break; case 1081: text = "EM_FORMATRANGE"; break; case 1082: text = "EM_GETCHARFORMAT"; break; case 1083: text = "EM_GETEVENTMASK"; break; case 1084: text = "EM_GETOLEINTERFACE"; break; case 1085: text = "EM_GETPARAFORMAT"; break; case 1086: text = "EM_GETSELTEXT"; break; case 1087: text = "EM_HIDESELECTION"; break; case 1088: text = "EM_PASTESPECIAL"; break; case 1089: text = "EM_REQUESTRESIZE"; break; case 1090: text = "EM_SELECTIONTYPE"; break; case 1091: text = "EM_SETBKGNDCOLOR"; break; case 1092: text = "EM_SETCHARFORMAT"; break; case 1093: text = "EM_SETEVENTMASK"; break; case 1094: text = "EM_SETOLECALLBACK"; break; case 1095: text = "EM_SETPARAFORMAT"; break; case 1096: text = "EM_SETTARGETDEVICE"; break; case 1097: text = "EM_STREAMIN"; break; case 1098: text = "EM_STREAMOUT"; break; case 1099: text = "EM_GETTEXTRANGE"; break; case 1100: text = "EM_FINDWORDBREAK"; break; case 1101: text = "EM_SETOPTIONS"; break; case 1102: text = "EM_GETOPTIONS"; break; case 1103: text = "EM_FINDTEXTEX"; break; case 1104: text = "EM_GETWORDBREAKPROCEX"; break; case 1105: text = "EM_SETWORDBREAKPROCEX"; break; case 1106: text = "EM_SETUNDOLIMIT"; break; case 1108: text = "EM_REDO"; break; case 1109: text = "EM_CANREDO"; break; case 1110: text = "EM_GETUNDONAME"; break; case 1111: text = "EM_GETREDONAME"; break; case 1112: text = "EM_STOPGROUPTYPING"; break; case 1113: text = "EM_SETTEXTMODE"; break; case 1114: text = "EM_GETTEXTMODE"; break; case 1115: text = "EM_AUTOURLDETECT"; break; case 1116: text = "EM_GETAUTOURLDETECT"; break; case 1117: text = "EM_SETPALETTE"; break; case 1118: text = "EM_GETTEXTEX"; break; case 1119: text = "EM_GETTEXTLENGTHEX"; break; case 1124: text = "EM_SETPUNCTUATION"; break; case 1125: text = "EM_GETPUNCTUATION"; break; case 1126: text = "EM_SETWORDWRAPMODE"; break; case 1127: text = "EM_GETWORDWRAPMODE"; break; case 1128: text = "EM_SETIMECOLOR"; break; case 1129: text = "EM_GETIMECOLOR"; break; case 1130: text = "EM_SETIMEOPTIONS"; break; case 1131: text = "EM_GETIMEOPTIONS"; break; case 1132: text = "EM_CONVPOSITION"; break; case 1144: text = "EM_SETLANGOPTIONS"; break; case 1145: text = "EM_GETLANGOPTIONS"; break; case 1146: text = "EM_GETIMECOMPMODE"; break; case 1147: text = "EM_FINDTEXTW"; break; case 1148: text = "EM_FINDTEXTEXW"; break; case 1149: text = "EM_RECONVERSION"; break; case 1150: text = "EM_SETIMEMODEBIAS"; break; case 1151: text = "EM_GETIMEMODEBIAS"; break; case 1224: text = "EM_SETBIDIOPTIONS"; break; case 1225: text = "EM_GETBIDIOPTIONS"; break; case 1226: text = "EM_SETTYPOGRAPHYOPTIONS"; break; case 1227: text = "EM_GETTYPOGRAPHYOPTIONS"; break; case 1228: text = "EM_SETEDITSTYLE"; break; case 1229: text = "EM_GETEDITSTYLE"; break; default: text = null; break; } string text2 = text; if (text2 == null && (_id & 8192) == 8192) { string str = ((MessageId)(_id - 8192)).MessageIdToString() ?? "???"; text2 = "WM_REFLECT + " + str; } return text2; } } }