找回密码
 立即注册→加入我们

QQ登录

只需一步,快速开始

搜索
热搜: 下载 VB C 实现 编写
查看: 4331|回复: 1

【API】调试用打印Windows窗口消息名称的函数

[复制链接]
发表于 2015-7-27 23:39:21 | 显示全部楼层 |阅读模式

欢迎访问技术宅的结界,请注册或者登录吧。

您需要 登录 才可以下载或查看,没有账号?立即注册→加入我们

×
  1. const char*GetMessageName(UINT Msg)
  2. {
  3.         switch(Msg)
  4.         {
  5.         case WM_NULL:return"WM_NULL";
  6.         case WM_CREATE:return"WM_CREATE";
  7.         case WM_DESTROY:return"WM_DESTROY";
  8.         case WM_MOVE:return"WM_MOVE";
  9.         case WM_SIZE:return"WM_SIZE";
  10.         case WM_ACTIVATE:return"WM_ACTIVATE";
  11.         case WM_SETFOCUS:return"WM_SETFOCUS";
  12.         case WM_KILLFOCUS:return"WM_KILLFOCUS";
  13.         case WM_ENABLE:return"WM_ENABLE";
  14.         case WM_SETREDRAW:return"WM_SETREDRAW";
  15.         case WM_SETTEXT:return"WM_SETTEXT";
  16.         case WM_GETTEXT:return"WM_GETTEXT";
  17.         case WM_GETTEXTLENGTH:return"WM_GETTEXTLENGTH";
  18.         case WM_PAINT:return"WM_PAINT";
  19.         case WM_CLOSE:return"WM_CLOSE";
  20.         case WM_QUERYENDSESSION:return"WM_QUERYENDSESSION";
  21.         case WM_QUERYOPEN:return"WM_QUERYOPEN";
  22.         case WM_ENDSESSION:return"WM_ENDSESSION";
  23.         case WM_QUIT:return"WM_QUIT";
  24.         case WM_ERASEBKGND:return"WM_ERASEBKGND";
  25.         case WM_SYSCOLORCHANGE:return"WM_SYSCOLORCHANGE";
  26.         case WM_SHOWWINDOW:return"WM_SHOWWINDOW";
  27.         case WM_SETTINGCHANGE:return"WM_SETTINGCHANGE";
  28.         case WM_DEVMODECHANGE:return"WM_DEVMODECHANGE";
  29.         case WM_ACTIVATEAPP:return"WM_ACTIVATEAPP";
  30.         case WM_FONTCHANGE:return"WM_FONTCHANGE";
  31.         case WM_TIMECHANGE:return"WM_TIMECHANGE";
  32.         case WM_CANCELMODE:return"WM_CANCELMODE";
  33.         case WM_SETCURSOR:return"WM_SETCURSOR";
  34.         case WM_MOUSEACTIVATE:return"WM_MOUSEACTIVATE";
  35.         case WM_CHILDACTIVATE:return"WM_CHILDACTIVATE";
  36.         case WM_QUEUESYNC:return"WM_QUEUESYNC";
  37.         case WM_GETMINMAXINFO:return"WM_GETMINMAXINFO";
  38.         case WM_PAINTICON:return"WM_PAINTICON";
  39.         case WM_ICONERASEBKGND:return"WM_ICONERASEBKGND";
  40.         case WM_NEXTDLGCTL:return"WM_NEXTDLGCTL";
  41.         case WM_SPOOLERSTATUS:return"WM_SPOOLERSTATUS";
  42.         case WM_DRAWITEM:return"WM_DRAWITEM";
  43.         case WM_MEASUREITEM:return"WM_MEASUREITEM";
  44.         case WM_DELETEITEM:return"WM_DELETEITEM";
  45.         case WM_VKEYTOITEM:return"WM_VKEYTOITEM";
  46.         case WM_CHARTOITEM:return"WM_CHARTOITEM";
  47.         case WM_SETFONT:return"WM_SETFONT";
  48.         case WM_GETFONT:return"WM_GETFONT";
  49.         case WM_SETHOTKEY:return"WM_SETHOTKEY";
  50.         case WM_GETHOTKEY:return"WM_GETHOTKEY";
  51.         case WM_QUERYDRAGICON:return"WM_QUERYDRAGICON";
  52.         case WM_COMPAREITEM:return"WM_COMPAREITEM";
  53.         case WM_GETOBJECT:return"WM_GETOBJECT";
  54.         case WM_COMPACTING:return"WM_COMPACTING";
  55.         case WM_COMMNOTIFY:return"WM_COMMNOTIFY";
  56.         case WM_WINDOWPOSCHANGING:return"WM_WINDOWPOSCHANGING";
  57.         case WM_WINDOWPOSCHANGED:return"WM_WINDOWPOSCHANGED";
  58.         case WM_POWER:return"WM_POWER";
  59.         case WM_COPYDATA:return"WM_COPYDATA";
  60.         case WM_CANCELJOURNAL:return"WM_CANCELJOURNAL";
  61.         case WM_NOTIFY:return"WM_NOTIFY";
  62.         case WM_INPUTLANGCHANGEREQUEST:return"WM_INPUTLANGCHANGEREQUEST";
  63.         case WM_INPUTLANGCHANGE:return"WM_INPUTLANGCHANGE";
  64.         case WM_TCARD:return"WM_TCARD";
  65.         case WM_HELP:return"WM_HELP";
  66.         case WM_USERCHANGED:return"WM_USERCHANGED";
  67.         case WM_NOTIFYFORMAT:return"WM_NOTIFYFORMAT";
  68.         case WM_CONTEXTMENU:return"WM_CONTEXTMENU";
  69.         case WM_STYLECHANGING:return"WM_STYLECHANGING";
  70.         case WM_STYLECHANGED:return"WM_STYLECHANGED";
  71.         case WM_DISPLAYCHANGE:return"WM_DISPLAYCHANGE";
  72.         case WM_GETICON:return"WM_GETICON";
  73.         case WM_SETICON:return"WM_SETICON";
  74.         case WM_NCCREATE:return"WM_NCCREATE";
  75.         case WM_NCDESTROY:return"WM_NCDESTROY";
  76.         case WM_NCCALCSIZE:return"WM_NCCALCSIZE";
  77.         case WM_NCHITTEST:return"WM_NCHITTEST";
  78.         case WM_NCPAINT:return"WM_NCPAINT";
  79.         case WM_NCACTIVATE:return"WM_NCACTIVATE";
  80.         case WM_GETDLGCODE:return"WM_GETDLGCODE";
  81.         case WM_SYNCPAINT:return"WM_SYNCPAINT";
  82.         case WM_NCMOUSEMOVE:return"WM_NCMOUSEMOVE";
  83.         case WM_NCLBUTTONDOWN:return"WM_NCLBUTTONDOWN";
  84.         case WM_NCLBUTTONUP:return"WM_NCLBUTTONUP";
  85.         case WM_NCLBUTTONDBLCLK:return"WM_NCLBUTTONDBLCLK";
  86.         case WM_NCRBUTTONDOWN:return"WM_NCRBUTTONDOWN";
  87.         case WM_NCRBUTTONUP:return"WM_NCRBUTTONUP";
  88.         case WM_NCRBUTTONDBLCLK:return"WM_NCRBUTTONDBLCLK";
  89.         case WM_NCMBUTTONDOWN:return"WM_NCMBUTTONDOWN";
  90.         case WM_NCMBUTTONUP:return"WM_NCMBUTTONUP";
  91.         case WM_NCMBUTTONDBLCLK:return"WM_NCMBUTTONDBLCLK";
  92.         case WM_NCXBUTTONDOWN:return"WM_NCXBUTTONDOWN";
  93.         case WM_NCXBUTTONUP:return"WM_NCXBUTTONUP";
  94.         case WM_NCXBUTTONDBLCLK:return"WM_NCXBUTTONDBLCLK";
  95.         case WM_INPUT_DEVICE_CHANGE:return"WM_INPUT_DEVICE_CHANGE";
  96.         case WM_INPUT:return"WM_INPUT";
  97.         case WM_KEYDOWN:return"WM_KEYDOWN";
  98.         case WM_KEYUP:return"WM_KEYUP";
  99.         case WM_CHAR:return"WM_CHAR";
  100.         case WM_DEADCHAR:return"WM_DEADCHAR";
  101.         case WM_SYSKEYDOWN:return"WM_SYSKEYDOWN";
  102.         case WM_SYSKEYUP:return"WM_SYSKEYUP";
  103.         case WM_SYSCHAR:return"WM_SYSCHAR";
  104.         case WM_SYSDEADCHAR:return"WM_SYSDEADCHAR";
  105.         case WM_KEYLAST:return"WM_KEYLAST";
  106.         case WM_IME_STARTCOMPOSITION:return"WM_IME_STARTCOMPOSITION";
  107.         case WM_IME_ENDCOMPOSITION:return"WM_IME_ENDCOMPOSITION";
  108.         case WM_IME_COMPOSITION:return"WM_IME_COMPOSITION";
  109.         case WM_INITDIALOG:return"WM_INITDIALOG";
  110.         case WM_COMMAND:return"WM_COMMAND";
  111.         case WM_SYSCOMMAND:return"WM_SYSCOMMAND";
  112.         case WM_TIMER:return"WM_TIMER";
  113.         case WM_HSCROLL:return"WM_HSCROLL";
  114.         case WM_VSCROLL:return"WM_VSCROLL";
  115.         case WM_INITMENU:return"WM_INITMENU";
  116.         case WM_INITMENUPOPUP:return"WM_INITMENUPOPUP";
  117.         case WM_GESTURE:return"WM_GESTURE";
  118.         case WM_GESTURENOTIFY:return"WM_GESTURENOTIFY";
  119.         case WM_MENUSELECT:return"WM_MENUSELECT";
  120.         case WM_MENUCHAR:return"WM_MENUCHAR";
  121.         case WM_ENTERIDLE:return"WM_ENTERIDLE";
  122.         case WM_MENURBUTTONUP:return"WM_MENURBUTTONUP";
  123.         case WM_MENUDRAG:return"WM_MENUDRAG";
  124.         case WM_MENUGETOBJECT:return"WM_MENUGETOBJECT";
  125.         case WM_UNINITMENUPOPUP:return"WM_UNINITMENUPOPUP";
  126.         case WM_MENUCOMMAND:return"WM_MENUCOMMAND";
  127.         case WM_CHANGEUISTATE:return"WM_CHANGEUISTATE";
  128.         case WM_UPDATEUISTATE:return"WM_UPDATEUISTATE";
  129.         case WM_QUERYUISTATE:return"WM_QUERYUISTATE";
  130.         case WM_CTLCOLORMSGBOX:return"WM_CTLCOLORMSGBOX";
  131.         case WM_CTLCOLOREDIT:return"WM_CTLCOLOREDIT";
  132.         case WM_CTLCOLORLISTBOX:return"WM_CTLCOLORLISTBOX";
  133.         case WM_CTLCOLORBTN:return"WM_CTLCOLORBTN";
  134.         case WM_CTLCOLORDLG:return"WM_CTLCOLORDLG";
  135.         case WM_CTLCOLORSCROLLBAR:return"WM_CTLCOLORSCROLLBAR";
  136.         case WM_CTLCOLORSTATIC:return"WM_CTLCOLORSTATIC";
  137.         case WM_MOUSEMOVE:return"WM_MOUSEMOVE";
  138.         case WM_LBUTTONDOWN:return"WM_LBUTTONDOWN";
  139.         case WM_LBUTTONUP:return"WM_LBUTTONUP";
  140.         case WM_LBUTTONDBLCLK:return"WM_LBUTTONDBLCLK";
  141.         case WM_RBUTTONDOWN:return"WM_RBUTTONDOWN";
  142.         case WM_RBUTTONUP:return"WM_RBUTTONUP";
  143.         case WM_RBUTTONDBLCLK:return"WM_RBUTTONDBLCLK";
  144.         case WM_MBUTTONDOWN:return"WM_MBUTTONDOWN";
  145.         case WM_MBUTTONUP:return"WM_MBUTTONUP";
  146.         case WM_MBUTTONDBLCLK:return"WM_MBUTTONDBLCLK";
  147.         case WM_MOUSEWHEEL:return"WM_MOUSEWHEEL";
  148.         case WM_XBUTTONDOWN:return"WM_XBUTTONDOWN";
  149.         case WM_XBUTTONUP:return"WM_XBUTTONUP";
  150.         case WM_XBUTTONDBLCLK:return"WM_XBUTTONDBLCLK";
  151.         case WM_MOUSEHWHEEL:return"WM_MOUSEHWHEEL";
  152.         case WM_PARENTNOTIFY:return"WM_PARENTNOTIFY";
  153.         case WM_ENTERMENULOOP:return"WM_ENTERMENULOOP";
  154.         case WM_EXITMENULOOP:return"WM_EXITMENULOOP";
  155.         case WM_NEXTMENU:return"WM_NEXTMENU";
  156.         case WM_SIZING:return"WM_SIZING";
  157.         case WM_CAPTURECHANGED:return"WM_CAPTURECHANGED";
  158.         case WM_MOVING:return"WM_MOVING";
  159.         case WM_POWERBROADCAST:return"WM_POWERBROADCAST";
  160.         case WM_DEVICECHANGE:return"WM_DEVICECHANGE";
  161.         case WM_MDICREATE:return"WM_MDICREATE";
  162.         case WM_MDIDESTROY:return"WM_MDIDESTROY";
  163.         case WM_MDIACTIVATE:return"WM_MDIACTIVATE";
  164.         case WM_MDIRESTORE:return"WM_MDIRESTORE";
  165.         case WM_MDINEXT:return"WM_MDINEXT";
  166.         case WM_MDIMAXIMIZE:return"WM_MDIMAXIMIZE";
  167.         case WM_MDITILE:return"WM_MDITILE";
  168.         case WM_MDICASCADE:return"WM_MDICASCADE";
  169.         case WM_MDIICONARRANGE:return"WM_MDIICONARRANGE";
  170.         case WM_MDIGETACTIVE:return"WM_MDIGETACTIVE";
  171.         case WM_MDISETMENU:return"WM_MDISETMENU";
  172.         case WM_ENTERSIZEMOVE:return"WM_ENTERSIZEMOVE";
  173.         case WM_EXITSIZEMOVE:return"WM_EXITSIZEMOVE";
  174.         case WM_DROPFILES:return"WM_DROPFILES";
  175.         case WM_MDIREFRESHMENU:return"WM_MDIREFRESHMENU";
  176.         case WM_POINTERDEVICECHANGE:return"WM_POINTERDEVICECHANGE";
  177.         case WM_POINTERDEVICEINRANGE:return"WM_POINTERDEVICEINRANGE";
  178.         case WM_POINTERDEVICEOUTOFRANGE:return"WM_POINTERDEVICEOUTOFRANGE";
  179.         case WM_TOUCH:return"WM_TOUCH";
  180.         case WM_NCPOINTERUPDATE:return"WM_NCPOINTERUPDATE";
  181.         case WM_NCPOINTERDOWN:return"WM_NCPOINTERDOWN";
  182.         case WM_NCPOINTERUP:return"WM_NCPOINTERUP";
  183.         case WM_POINTERUPDATE:return"WM_POINTERUPDATE";
  184.         case WM_POINTERDOWN:return"WM_POINTERDOWN";
  185.         case WM_POINTERUP:return"WM_POINTERUP";
  186.         case WM_POINTERENTER:return"WM_POINTERENTER";
  187.         case WM_POINTERLEAVE:return"WM_POINTERLEAVE";
  188.         case WM_POINTERACTIVATE:return"WM_POINTERACTIVATE";
  189.         case WM_POINTERCAPTURECHANGED:return"WM_POINTERCAPTURECHANGED";
  190.         case WM_TOUCHHITTESTING:return"WM_TOUCHHITTESTING";
  191.         case WM_POINTERWHEEL:return"WM_POINTERWHEEL";
  192.         case WM_POINTERHWHEEL:return"WM_POINTERHWHEEL";
  193.         case WM_IME_SETCONTEXT:return"WM_IME_SETCONTEXT";
  194.         case WM_IME_NOTIFY:return"WM_IME_NOTIFY";
  195.         case WM_IME_CONTROL:return"WM_IME_CONTROL";
  196.         case WM_IME_COMPOSITIONFULL:return"WM_IME_COMPOSITIONFULL";
  197.         case WM_IME_SELECT:return"WM_IME_SELECT";
  198.         case WM_IME_CHAR:return"WM_IME_CHAR";
  199.         case WM_IME_REQUEST:return"WM_IME_REQUEST";
  200.         case WM_IME_KEYDOWN:return"WM_IME_KEYDOWN";
  201.         case WM_IME_KEYUP:return"WM_IME_KEYUP";
  202.         case WM_MOUSEHOVER:return"WM_MOUSEHOVER";
  203.         case WM_MOUSELEAVE:return"WM_MOUSELEAVE";
  204.         case WM_NCMOUSEHOVER:return"WM_NCMOUSEHOVER";
  205.         case WM_NCMOUSELEAVE:return"WM_NCMOUSELEAVE";
  206.         case WM_WTSSESSION_CHANGE:return"WM_WTSSESSION_CHANGE";
  207.         case WM_TABLET_FIRST:return"WM_TABLET_FIRST";
  208.         case WM_TABLET_LAST:return"WM_TABLET_LAST";
  209.         case WM_CUT:return"WM_CUT";
  210.         case WM_COPY:return"WM_COPY";
  211.         case WM_PASTE:return"WM_PASTE";
  212.         case WM_CLEAR:return"WM_CLEAR";
  213.         case WM_UNDO:return"WM_UNDO";
  214.         case WM_RENDERFORMAT:return"WM_RENDERFORMAT";
  215.         case WM_RENDERALLFORMATS:return"WM_RENDERALLFORMATS";
  216.         case WM_DESTROYCLIPBOARD:return"WM_DESTROYCLIPBOARD";
  217.         case WM_DRAWCLIPBOARD:return"WM_DRAWCLIPBOARD";
  218.         case WM_PAINTCLIPBOARD:return"WM_PAINTCLIPBOARD";
  219.         case WM_VSCROLLCLIPBOARD:return"WM_VSCROLLCLIPBOARD";
  220.         case WM_SIZECLIPBOARD:return"WM_SIZECLIPBOARD";
  221.         case WM_ASKCBFORMATNAME:return"WM_ASKCBFORMATNAME";
  222.         case WM_CHANGECBCHAIN:return"WM_CHANGECBCHAIN";
  223.         case WM_HSCROLLCLIPBOARD:return"WM_HSCROLLCLIPBOARD";
  224.         case WM_QUERYNEWPALETTE:return"WM_QUERYNEWPALETTE";
  225.         case WM_PALETTEISCHANGING:return"WM_PALETTEISCHANGING";
  226.         case WM_PALETTECHANGED:return"WM_PALETTECHANGED";
  227.         case WM_HOTKEY:return"WM_HOTKEY";
  228.         case WM_PRINT:return"WM_PRINT";
  229.         case WM_PRINTCLIENT:return"WM_PRINTCLIENT";
  230.         case WM_APPCOMMAND:return"WM_APPCOMMAND";
  231.         case WM_THEMECHANGED:return"WM_THEMECHANGED";
  232.         case WM_CLIPBOARDUPDATE:return"WM_CLIPBOARDUPDATE";
  233.         case WM_DWMCOMPOSITIONCHANGED:return"WM_DWMCOMPOSITIONCHANGED";
  234.         case WM_DWMNCRENDERINGCHANGED:return"WM_DWMNCRENDERINGCHANGED";
  235.         case WM_DWMCOLORIZATIONCOLORCHANGED:return"WM_DWMCOLORIZATIONCOLORCHANGED";
  236.         case WM_DWMWINDOWMAXIMIZEDCHANGE:return"WM_DWMWINDOWMAXIMIZEDCHANGE";
  237.         case WM_DWMSENDICONICTHUMBNAIL :return"WM_DWMSENDICONICTHUMBNAIL";
  238.         case WM_DWMSENDICONICLIVEPREVIEWBITMAP :return"WM_DWMSENDICONICLIVEPREVIEWBITMAP";
  239.         case WM_GETTITLEBARINFOEX:return"WM_GETTITLEBARINFOEX";
  240.         case WM_HANDHELDFIRST:return"WM_HANDHELDFIRST";
  241.         case WM_HANDHELDLAST:return"WM_HANDHELDLAST";
  242.         case WM_AFXFIRST:return"WM_AFXFIRST";
  243.         case WM_AFXLAST:return"WM_AFXLAST";
  244.         case WM_PENWINFIRST:return"WM_PENWINFIRST";
  245.         case WM_PENWINLAST:return"WM_PENWINLAST";
  246.         default:return"Unknown";
  247.         }
  248. }
复制代码
回复

使用道具 举报

发表于 2015-7-31 00:56:38 | 显示全部楼层
简单粗暴的方法……
回复 赞! 靠!

使用道具 举报

本版积分规则

QQ|Archiver|小黑屋|技术宅的结界 ( 滇ICP备16008837号 )|网站地图

GMT+8, 2024-11-23 16:20 , Processed in 0.040636 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表