Hi.
Two small suggestions.
+static char *command_to_string(UINT command)
It could be const char.
+{ +#define X(x) case x: return #x + + switch (command) + { + X( HH_DISPLAY_TOPIC ); + X( HH_DISPLAY_TOC ); + X( HH_DISPLAY_INDEX ); + X( HH_DISPLAY_SEARCH ); + X( HH_SET_WIN_TYPE ); + X( HH_GET_WIN_TYPE ); + X( HH_GET_WIN_HANDLE ); + X( HH_ENUM_INFO_TYPE ); + X( HH_SET_INFO_TYPE ); + X( HH_SYNC ); + X( HH_RESERVED1 ); + X( HH_RESERVED2 ); + X( HH_RESERVED3 ); + X( HH_KEYWORD_LOOKUP ); + X( HH_DISPLAY_TEXT_POPUP ); + X( HH_HELP_CONTEXT ); + X( HH_TP_HELP_CONTEXTMENU ); + X( HH_TP_HELP_WM_HELP ); + X( HH_CLOSE_ALL ); + X( HH_ALINK_LOOKUP ); + X( HH_GET_LAST_ERROR ); + X( HH_ENUM_CATEGORY ); + X( HH_ENUM_CATEGORY_IT ); + X( HH_RESET_IT_FILTER ); + X( HH_SET_INCLUSIVE_FILTER ); + X( HH_SET_EXCLUSIVE_FILTER ); + X( HH_INITIALIZE ); + X( HH_UNINITIALIZE ); + X( HH_PRETRANSLATEMESSAGE ); + X( HH_SET_GLOBAL_PROPERTY ); + } + +#undef X +}
If command is not one of specificed in switch, function won't return a valid string.
Thanks, Jacek