Yes Ron you can subclass like that. Several subclasses can share the same subclass procedure and the ID(uIdSubclass) can identify each call.
Function DialogButtonSubclassExample
in #1 you would have to use something like
to see the id
Function DialogButtonSubclassExample
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Button 0x54032000 0x0 32 72 48 14 "Button1"
;4 Button 0x54032000 0x0 96 72 48 14 "Button2"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040802 "*" "" "" ""
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,SetWindowSubclass(id(3 hDlg) &sub.Button_Subclass 3 0)
,SetWindowSubclass(id(4 hDlg) &sub.Button_Subclass 4 0)
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#sub Button_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData
;OutWinMsg message wParam lParam ;;uncomment to see received messages
sel message
,case WM_LBUTTONDOWN
,sel uIdSubclass
,,case 3
,,out "left click Button1"
,,case 4
,,out "left click Button2"
int R=DefSubclassProc(hwnd message wParam lParam)
sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.Button_Subclass uIdSubclass)
,
,;case ...
ret Rin #1 you would have to use something like
to see the id
