First, of all, you should get the active tree grid window inside the property grid control:
CExtPropertyGridCtrl * pPGC = . . .
CExtPropertyGridWnd * pPGW = GetActiveGrid();
if( pPGW == NULL )
return . . .
Second, you should get the focused tree item:
HTREEITEM hti = pPGW->ItemFocusGet();
if( hti == NULL )
return . . .
Third, you should get property item which corresponds to the focused tree item.
CExtPropertyItem * pPI = pPGW->PropertyItemFromTreeItem( hti );
if( pPI == NULL )
return . . .
Fourth, the property item can be a property category. User always change property values - not categories. So, you should also check whether focused row in tree grid is property value row:
CExtPropertyValue * pValue = DYNAMIC_DOWNCAST( CExtPropertyValue, pPI );
if( pValue == NULL )
return . . .