I am wanting to implement a rich edit control into my application, but I have not
been able to trap notification messages from the control. The following program
demonstrates my problem. When I start typing in the control, a MSGBOX should
pop up if I have successfully trapped the %RN_UPDATE message, but it doesn't.
Thanks for any help that can be offered.
'-----------------------------------------------------------
been able to trap notification messages from the control. The following program
demonstrates my problem. When I start typing in the control, a MSGBOX should
pop up if I have successfully trapped the %RN_UPDATE message, but it doesn't.
Thanks for any help that can be offered.
'-----------------------------------------------------------
Code:
#INCLUDE "WIN32API.INC" #INCLUDE "COMMCTRL.INC" #INCLUDE "RICHEDIT.INC" %ID_RichEdit = 500 GLOBAL hEdit AS LONG DECLARE CALLBACK FUNCTION dlgCallback() DECLARE FUNCTION newEditProc&(BYVAL h&, BYVAL wMsg&, BYVAL wParm&, BYVAL lParm&) FUNCTION PBMAIN LOCAL hDlg AS LONG, hRichEd AS LONG, rText AS STRING LoadLibrary "RICHED32.DLL" CALL InitCommonControls DIALOG NEW 0, "DDT RichEdit demo",,, 150, 90, %WS_SYSMENU TO hDlg CONTROL ADD "RichEdit", hDlg, %ID_RichEdit, "", 5, 20, 120, 12, _ %WS_CHILD + %WS_VISIBLE, %WS_EX_CLIENTEDGE DIALOG SHOW MODAL hDlg CALL dlgCallback END FUNCTION CALLBACK FUNCTION dlgCallback() SELECT CASE CBMSG CASE %WM_INITDIALOG CONTROL HANDLE CBHNDL, %ID_RichEdit TO hEdit CONTROL SET FOCUS CBHNDL, %ID_RichEdit CASE %WM_COMMAND IF CBCTLMSG = %EN_UPDATE THEN MSGBOX "here END IF END SELECT END FUNCTION
Comment