According to the documentation WM_CREATE should return 0 or -1. I analyze a code where WM_CREATE returns TRUE:
return TRUE; //TRUE translates to 1: #define TRUE 1
//TRUE is defined in minwindef.h
Is it a bug in the code or returning TRUE is allowed and has some meaning ?
CodePudding user response:
0 and -1 are the only documented values you can return when processing WM_CREATE. Most likely anything other than -1 is treated as success but the code is technically broken and should be changed to return 0.
What most likely happened is that someone looked at WM_INITDIALOG where TRUE is a valid return value.
