Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <map>
- // The define map could probably be made part of CWindowsMessageToString
- static std::map<int, const TCHAR*> defineMap
- #define DEFINE_MESSAGE(wm) defineMap.insert( pair<int, char*>(wm, TEXT(#wm)) )
- CWindowsMessageToString::CWindowsMessageToString()
- {
- DEFINE_MESSAGE(WM_CREATE);
- DEFINE_MESSAGE(WM_DESTROY);
- DEFINE_MESSAGE(WM_MOVE);
- DEFINE_MESSAGE(WM_SIZE);
- // ...
- }
- TCHAR *CWindowsMessageToString::GetStringFromMsg( DWORD dwMessage, bool bShowFrequentMessages )
- {
- //...
- if (defineMap.find(dwMessage))
- {
- return defineMap[dwMessage];
- }
- return NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement