In My Humble Opinion the WM_COMMAND management should be different, put on TWindow and/or TDialog something like:
METHOD Command( nWParam, nLParam )
local nNotifyCode, nID, hWndCtl, oCtrl
nNotifyCode = nHiWord( nWParam )
nID = nLoWord( nWParam )
hWndCtl = nLParam
do case
case ::oPopup != nil
::oPopup:Command( nID )
case hWndCtl == 0 .and. ::oMenu != nil .and. ;
nNotifyCode == BN_CLICKED .and. nID != IDCANCEL
::oMenu:Command( nID )
case (oCtrl := oWndFromHwnd( hWndCtl )) != nil .and. oCtrl:isKindOf("TCONTROL")
oCtrl:Command( nWParam, nLParam )
endcase
return nil
add an empty implementation on TControl, and move other case on respective classes, for example BN_CLICKED is only on button, CBN_SELCHANGE is only on ComboBox...