#ifndef __DBGCDRAW_H_INCLUDED #define __DBGCDRAW_H_INCLUDED #ifndef ARRAYSIZE #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) #endif #define MKFLAG(x) { (x), TEXT(#x) } struct FlagString { DWORD dwFlag; LPCTSTR pszString; }; inline LPCTSTR GetString( LPTSTR szString, FlagString *pFlagStrings, size_t nSize, DWORD dwValue, bool bFlag ) { TCHAR szFlag[200] = TEXT(""); wsprintf( szFlag, TEXT("(0x%08X)"), dwValue ); TCHAR szText[256] = TEXT(""); lstrcpy( szString, TEXT("") ); if (bFlag) { for (size_t i=0;i(lParam)->hwndFrom, szClassName, sizeof(szClassName)/sizeof(szClassName[0]) )) { if (!pszControlType || !lstrcmp(pszControlType,szClassName)) { if (!dwDrawStage || dwDrawStage == reinterpret_cast(lParam)->dwDrawStage) { TCHAR szBuffer[MAX_PATH]; WIA_TRACE((TEXT("Dumping Custom Draw for control: [%s]"), szClassName )); #if 0 WIA_TRACE((TEXT(" hwndFrom: 0x%p"),reinterpret_cast(lParam)->hwndFrom )); WIA_TRACE((TEXT(" idFrom: %d"),reinterpret_cast(lParam)->idFrom )); WIA_TRACE((TEXT(" code: %d"),reinterpret_cast(lParam)->code )); #endif WIA_TRACE((TEXT(" dwDrawStage: %s"),GetString(szBuffer,DrawStages,ARRAYSIZE(DrawStages),reinterpret_cast(lParam)->dwDrawStage,false))); WIA_TRACE((TEXT(" hdc: %p"),reinterpret_cast(lParam)->hdc )); WIA_TRACE((TEXT(" rc: (%d,%d), (%d,%d)"),reinterpret_cast(lParam)->rc.left, reinterpret_cast(lParam)->rc.top,reinterpret_cast(lParam)->rc.right,reinterpret_cast(lParam)->rc.bottom )); WIA_TRACE((TEXT(" dwItemSpec: %d"),reinterpret_cast(lParam)->dwItemSpec )); WIA_TRACE((TEXT(" uItemState: %s"),GetString(szBuffer,ItemStates,ARRAYSIZE(ItemStates),reinterpret_cast(lParam)->uItemState,true))); WIA_TRACE((TEXT(" lItemlParam: 0x%p"),reinterpret_cast(lParam)->lItemlParam )); if (!lstrcmp(TEXT("SysListView32"),szClassName)) { WIA_TRACE((TEXT(" clrText: RGB(0x%02X,0x%02X,0x%02X)"),GetRValue(reinterpret_cast(lParam)->clrText),GetGValue(reinterpret_cast(lParam)->clrText),GetBValue(reinterpret_cast(lParam)->clrText) )); WIA_TRACE((TEXT(" clrTextBk: RGB(0x%02X,0x%02X,0x%02X)"),GetRValue(reinterpret_cast(lParam)->clrTextBk),GetGValue(reinterpret_cast(lParam)->clrTextBk),GetBValue(reinterpret_cast(lParam)->clrTextBk) )); WIA_TRACE((TEXT(" iSubItem: %d"),reinterpret_cast(lParam)->iSubItem )); } WIA_TRACE((TEXT(""))); } } } } #endif //__DBGCDRAW_H_INCLUDED