Hi there,
just had a look on some C code generated by winCFront from CPP
sources. Most interesting is the implementation of message mapping.
I guess with a procedural lang. like PB most users will reflect msgs
by forwarding them to the windows it belongs.
iE. %WM_CTLCOLOREDIT handeld by MainWndProc like this :
refelected by control's wndProc
The c code doesn't use sendmessage. It call's SuperEditProc direct,
after retrieiving the wndProc CodePtr via GetWindowLong.
Do you see any benefits calling the child wndProc directly ?
Ralph
------------------
just had a look on some C code generated by winCFront from CPP
sources. Most interesting is the implementation of message mapping.
I guess with a procedural lang. like PB most users will reflect msgs
by forwarding them to the windows it belongs.
iE. %WM_CTLCOLOREDIT handeld by MainWndProc like this :
Code:
CALLBACK FUNCTION MainWndProc SELECT CASE CBMSG CASE %WM_COMMAND CASE %WM_CTLCOLOREDIT : FUNCTION = sendmessage ( CBLPARAM, %WM_CTLCOLOR_REFLECT, CBWPARAM, 0 ) END SELECT END FUNCTION
Code:
FUNCTION SuperEditProc( BYVAL hWnd AS LONG, BYVAL wMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG ) AS LONG SELECT CASE wMsg CASE %WM_CREATE : edit_create hWnd, OffsetWndExtra CASE %WM_DESTROY : edit_destroy hWnd, OffsetWndExtra CASE %WM_CTLCOLOR_REFLECT SetBkColor WPARAM, GetSysColor( %COLOR_HIGHLIGHT ) SetTextColor WPARAM, %CYAN FUNCTION = gETsTOCKoBJECT(%GRAY_BRUSH) EXIT FUNCTION END SELECT FUNCTION = CallWindowProc(BaseWndProc, hWnd, wMsg, WPARAM, LPARAM) END FUNCTION
after retrieiving the wndProc CodePtr via GetWindowLong.
Do you see any benefits calling the child wndProc directly ?
Ralph
------------------
Comment