The default for Windows rich edit controls (editor gadgets) is NOT to send notification of such 'change' events to the parent window.
To enable this you need to set the 'event mask' as shown below:
Code: Select all
If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
EditorGadget(0, 8, 8, 306, 133)
;Add the following line to enable the editor gadget to send #EN_CHANGE notifications.
SendMessage_(GadgetID(0), #EM_SETEVENTMASK, 0, SendMessage_(GadgetID(0), #EM_GETEVENTMASK, 0,0)|#ENM_CHANGE)
For a = 0 To 5
AddGadgetItem(0, a, "Line "+Str(a))
Next
Repeat
Event = WaitWindowEvent()
Select EventType()
Case #PB_EventType_Change
Debug 1
EndSelect
Until Event = #PB_Event_CloseWindow
End
EndIf

You must remember that Windows can send literally thousands of different kinds of message and Purebasic can't really hope to sift through them all; it'd be a nightmare! EventType() is there to make our lives a little easier when dealing with gadgets and their many possible events.
Beyond this, if a little 'fine tuning' is required then we are generally looking at using a callback.
As for EventWParam(), my advice - don't use it! If you consider using this, then I would go straight for a callback.