c - Translate message value to macro? -


this question has answer here:

i need translate value corresponding message macro, such 0x100 wm_keydown.

is there exists open source implementation of this?

unless api vendor provides way it, you're out of luck, , you're going have yourself. # stringification operator type less:

struct macromap {     int macro,     char *name; };  #define map_entry(macro)  { macro, #macro }  struct macromap map[] =  {   map_entry(wm_keydown),   map_entry(wm_somethingelse),     .     .     . }; 

Comments