33 return "WM_ACTIVATE ";
36 return "WM_ACTIVATEAPP ";
39 return "WM_AFXFIRST ";
45 return "WM_ASKCBFORMATNAME ";
48 return "WM_CANCELJOURNAL ";
51 return "WM_CANCELMODE ";
54 return "WM_CAPTURECHANGED ";
57 return "WM_CHANGECBCHAIN ";
63 return "WM_CHARTOITEM ";
66 return "WM_CHILDACTIVATE ";
78 return "WM_COMMNOTIFY ";
81 return "WM_COMPACTING ";
84 return "WM_COMPAREITEM ";
87 return "WM_CONTEXTMENU ";
93 return "WM_COPYDATA ";
99 return "WM_CTLCOLORBTN ";
102 return "WM_CTLCOLORDLG ";
105 return "WM_CTLCOLOREDIT ";
108 return "WM_CTLCOLORLISTBOX ";
111 return "WM_CTLCOLORMSGBOX ";
114 return "WM_CTLCOLORSCROLLBAR ";
117 return "WM_CTLCOLORSTATIC ";
123 return "WM_DEADCHAR ";
126 return "WM_DELETEITEM ";
129 return "WM_DESTROY ";
132 return "WM_DESTROYCLIPBOARD ";
135 return "WM_DEVICECHANGE ";
138 return "WM_DEVMODECHANGE ";
141 return "WM_DISPLAYCHANGE ";
144 return "WM_DRAWCLIPBOARD ";
147 return "WM_DRAWITEM ";
150 return "WM_DROPFILES ";
156 return "WM_ENDSESSION ";
159 return "WM_ENTERIDLE ";
162 return "WM_ENTERMENULOOP ";
165 return "WM_ENTERSIZEMOVE ";
168 return "WM_ERASEBKGND ";
171 return "WM_EXITMENULOOP ";
174 return "WM_EXITSIZEMOVE ";
177 return "WM_FONTCHANGE ";
180 return "WM_GETDLGCODE ";
183 return "WM_GETFONT ";
186 return "WM_GETHOTKEY ";
189 return "WM_GETICON ";
192 return "WM_GETMINMAXINFO ";
195 return "WM_GETTEXT ";
198 return "WM_GETTEXTLENGTH ";
201 return "WM_HANDHELDFIRST ";
204 return "WM_HANDHELDLAST ";
213 return "WM_HSCROLL ";
216 return "WM_HSCROLLCLIPBOARD ";
219 return "WM_ICONERASEBKGND ";
222 return "WM_INITDIALOG ";
225 return "WM_INITMENU ";
228 return "WM_INITMENUPOPUP ";
234 return "WM_INPUTLANGCHANGE ";
237 return "WM_INPUTLANGCHANGEREQUEST ";
240 return "WM_KEYDOWN ";
246 return "WM_KILLFOCUS ";
249 return "WM_MDIACTIVATE ";
252 return "WM_MDICASCADE ";
255 return "WM_MDICREATE ";
258 return "WM_MDIDESTROY ";
261 return "WM_MDIGETACTIVE ";
264 return "WM_MDIICONARRANGE ";
267 return "WM_MDIMAXIMIZE ";
270 return "WM_MDINEXT ";
273 return "WM_MDIREFRESHMENU ";
276 return "WM_MDIRESTORE ";
279 return "WM_MDISETMENU ";
282 return "WM_MDITILE ";
285 return "WM_MEASUREITEM ";
288 return "WM_GETOBJECT ";
291 return "WM_CHANGEUISTATE ";
294 return "WM_UPDATEUISTATE ";
297 return "WM_QUERYUISTATE ";
300 return "WM_UNINITMENUPOPUP ";
303 return "WM_MENURBUTTONUP ";
306 return "WM_MENUCOMMAND ";
309 return "WM_MENUGETOBJECT ";
312 return "WM_MENUDRAG ";
315 return "WM_APPCOMMAND ";
318 return "WM_MENUCHAR ";
321 return "WM_MENUSELECT ";
324 return "WM_NEXTMENU ";
333 return "WM_NCACTIVATE ";
336 return "WM_NCCALCSIZE ";
339 return "WM_NCCREATE ";
342 return "WM_NCDESTROY ";
345 return "WM_NCHITTEST ";
348 return "WM_NCLBUTTONDBLCLK ";
351 return "WM_NCLBUTTONDOWN ";
354 return "WM_NCLBUTTONUP ";
357 return "WM_NCMBUTTONDBLCLK ";
360 return "WM_NCMBUTTONDOWN ";
363 return "WM_NCMBUTTONUP ";
366 return "WM_NCXBUTTONDOWN ";
369 return "WM_NCXBUTTONUP ";
372 return "WM_NCXBUTTONDBLCLK ";
375 return "WM_NCMOUSEHOVER ";
378 return "WM_NCMOUSELEAVE ";
381 return "WM_NCMOUSEMOVE ";
384 return "WM_NCPAINT ";
387 return "WM_NCRBUTTONDBLCLK ";
390 return "WM_NCRBUTTONDOWN ";
393 return "WM_NCRBUTTONUP ";
396 return "WM_NEXTDLGCTL ";
402 return "WM_NOTIFYFORMAT ";
411 return "WM_PAINTCLIPBOARD ";
414 return "WM_PAINTICON ";
417 return "WM_PALETTECHANGED ";
420 return "WM_PALETTEISCHANGING ";
423 return "WM_PARENTNOTIFY ";
429 return "WM_PENWINFIRST ";
432 return "WM_PENWINLAST ";
438 return "WM_POWERBROADCAST ";
444 return "WM_PRINTCLIENT ";
447 return "WM_QUERYDRAGICON ";
450 return "WM_QUERYENDSESSION ";
453 return "WM_QUERYNEWPALETTE ";
456 return "WM_QUERYOPEN ";
459 return "WM_QUEUESYNC ";
465 return "WM_RENDERALLFORMATS ";
468 return "WM_RENDERFORMAT ";
471 return "WM_SETCURSOR ";
474 return "WM_SETFOCUS ";
477 return "WM_SETFONT ";
480 return "WM_SETHOTKEY ";
483 return "WM_SETICON ";
486 return "WM_SETREDRAW ";
489 return "WM_SETTEXT ";
492 return "WM_SETTINGCHANGE ";
495 return "WM_SHOWWINDOW ";
501 return "WM_SIZECLIPBOARD ";
507 return "WM_SPOOLERSTATUS ";
510 return "WM_STYLECHANGED ";
513 return "WM_STYLECHANGING ";
516 return "WM_SYSCHAR ";
519 return "WM_SYSCOLORCHANGE ";
522 return "WM_SYSCOMMAND ";
525 return "WM_SYSDEADCHAR ";
528 return "WM_SYSKEYDOWN ";
531 return "WM_SYSKEYUP ";
537 return "WM_THEMECHANGED ";
540 return "WM_TIMECHANGE ";
552 return "WM_USERCHANGED ";
555 return "WM_VKEYTOITEM ";
558 return "WM_VSCROLL ";
561 return "WM_VSCROLLCLIPBOARD ";
564 return "WM_WINDOWPOSCHANGED ";
567 return "WM_WINDOWPOSCHANGING ";
570 return "WM_KEYLAST ";
573 return "WM_SYNCPAINT ";
576 return "WM_MOUSEACTIVATE ";
579 return "WM_MOUSEMOVE ";
582 return "WM_LBUTTONDOWN ";
585 return "WM_LBUTTONUP ";
588 return "WM_LBUTTONDBLCLK ";
591 return "WM_RBUTTONDOWN ";
594 return "WM_RBUTTONUP ";
597 return "WM_RBUTTONDBLCLK ";
600 return "WM_MBUTTONDOWN ";
603 return "WM_MBUTTONUP ";
606 return "WM_MBUTTONDBLCLK ";
609 return "WM_MOUSEWHEEL ";
612 return "WM_XBUTTONDOWN ";
615 return "WM_XBUTTONUP ";
618 return "WM_XBUTTONDBLCLK ";
621 return "WM_MOUSEHOVER ";
624 return "WM_MOUSELEAVE ";
628 sprintf(str,
"%d",msg);
639 DWORD dw = GetLastError();
642 FORMAT_MESSAGE_ALLOCATE_BUFFER |
643 FORMAT_MESSAGE_FROM_SYSTEM |
644 FORMAT_MESSAGE_IGNORE_INSERTS,
647 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
653 lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) *
sizeof(TCHAR));
655 snprintf((LPTSTR)lpDisplayBuf,
656 LocalSize(lpDisplayBuf) /
sizeof(TCHAR),
657 TEXT(
"%s failed with error %ld: %s"),
658 lpszFunction, dw, (
char *)lpMsgBuf);
659 MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT(
"Error"), MB_OK);
662 LocalFree(lpDisplayBuf);
const char * msg_num_to_name(int msg)
void win_perror(const char *lpszFunction)