More on VK_RETURN
Hey guys, I am having more trouble getting the return key from an edit window. Currently I am using a method which has usually worked well, Getting and Setting the window long from the edit control...but now it is not working....
...So, I am wondering if there is a better way- say, inserting a hook function into thew message loop. But I am unsure how this might be done? I mean, would the VK_RETURN run through the message loop even though it would be associated with that edit control? I just don't know. I just hate it that I cannot obtain all the keys very easily!
Anyway, any suggestions would be helpful.
Are you using the edit style ES_WANTRETURN? If not try addint that.
Yes. By the way, besides that what do you do? Do you use the method i first described?
Edits should handle their own text and do so with little help. Also the edit may be using default processing on the key strokes (default for ENTER is to click the default button on the dialog for single line edits or add a new line). I would not want to handle all the functions of the edit myself.
The problem is knowing WHEN to get the text from the edit.
The user may not push enter after they have typed in the text so I would not use that as a method of determining the end of a string.
The ES_WANTRETURN style only applies to multiline edits. It allows for the ENTER key to advance the line rather than the default (default button is sent BN_CLICKED msg).
Well currently, there is a "submit" button, and also, I have the capability to read the text in on the stroke of a timer(if text has changed, the buffer is updated). But I want to add the "return" key functionality as well....BTW, could I possibly add a line of code in the WinMain message loop that would indicate that the key was pressed? Hmmm, I'll try that. Any other ideas are welcome, of course...