More than once I heard a friend ask how to display windows messages in text format.
During debugging, messages in windows are displayed in numbers and cannot be intuitively displayed, as shown in figure
Wm_create message. If 1 is displayed during debugging, it is inconvenient for beginners.
Windows-like error messages can be viewed using errlook.
The formatmessage function can be used for text output for conversion of error messages. However, is there any API for conversion in windows such as wm_create messages,
I did not search for it, but it is not very difficult to write it by myself. So I listed the text of all messages in a table and converted it myself. A tool that converts a message value to a text value is as follows:
You can download the function from the following address, and the download package contains a text display function call.
Http://download.csdn.net/source/2134811
The function call method is as follows:
Put the three showwinmsg. dll showwinmsg. h showwinmsg. Lib files in the program directory.
Add the following two lines to stdafx. h:
# Include "showwinmsg. H"
# Pragma comment (Lib, "showwinmsg. lib ")
Call the getmessagestr function where the message text is displayed.
For example:
MessageBox (getmessagestr (nmessage ));
Attachment download
Http://download.csdn.net/source/2134811