I suspect that there are two windows in your implementation, one generic window and one dialog window.
The textbox is in dialog window and thus you cannot access the window message of the textbox through WndProc function. You should add the implementation for textbox processing in the "WndProc" function (it should have another name) of the dialog window.
If I understand wrong, please clarify your issue.
As a tip, you could set breakpoint to understand what is the code flow when the target event happens.