This morning double-click on a newly compiled application, the interface has just shown, and automatically triggered a menu event, opened a Web page. It was a real surprise. Close the window, double-click again, and automatically open a webpage, then close, and then double-click, do not automatically open the Web page. What's the situation?
To Baidu Search "MFC Menu ID range", found a post from CSDN:
Http://topic.csdn.net/t/20030708/14/2003847.html
See the content of the last person who replied (SXSLYY):
See MFC Windows Programming page 199th ID to be a multiple of 16, because Windows reserved the System menu ID of the low four bits of their own use, so use any one of them, you can get unexpected results.
I understand that the original menu ID can not set the value casually, otherwise you will encounter unexpected results.
Then I found a post from Microsoft:
ID Naming and number conventions
HTTP://TECHNET.MICROSOFT.COM/ZH-CN/LIBRARY/T2ZECHD4 (v=vs.110). aspx
To understand that the menu ID, the icon Asset ID, and the control ID all have respective different values.
about the scope of custom message values :
Implemented a custom message in the Code SendMessage (), today did not want to find the original custom message umsg value needs greater than wm_user, such as Wm_user+1, on the line, and then look at my original set value: 12345, fortunately there is no problem.
Wm_user (value: 1024)
To prevent user-defined message IDs from conflicting with the system's message ID, MS (Microsoft) defines a macro wm_user that is less than the Wm_user ID being used by the system, and that the ID greater than Wm_user is used by the user. 2012-09-22
Mfc:id Naming and numerical conventions