hi,
i was wondering if it was possible to capture the return key in a multiline edit box and if so how .im using win XP and dev c++ 4.And if you could help me apply word wrap to it?
thx in advance
hi,
i was wondering if it was possible to capture the return key in a multiline edit box and if so how .im using win XP and dev c++ 4.And if you could help me apply word wrap to it?
thx in advance
Theres a sucker born every minute, but a swallower is harder to find
Have you searched the board? I'm sure this question has been posted before.
-BURK
yes i have but they dont help me!
Theres a sucker born every minute, but a swallower is harder to find
>>yes i have but they dont help me!<<
Then you didn't try WM_GETDLGCODE as a search string. The information regarding trapping the 'return' key is to be found in different guises in those threads - there's probably others.
Use windows SUBCLASSING and intercept the enter or tab key
tempeditproc =(WNDPROC)SetWindowLong(hwndedit, GWL_WNDPROC, (LONG)editproc);
then process enter msg in your edit procedure which is assigned
temporarily to windows edit proc &release the job back to the original proc.
thx this might help but how would i go about processing the enter message sorry im not very good at thsi ive never done it . perhaps you have a snippet of code or some example that i could learn
Theres a sucker born every minute, but a swallower is harder to find
>>perhaps you have a snippet of code or some example that i could learn<<
From the search link I provided earlier: window subclassing and use of WM_GETDLGCODE - look for Fordy's 'msdn' example. If you intend for special processing with use of the return key then handle the WM_KEYDOWN/WM_KEYUP event in the subclass procedure for the edit control. Handling these messages in a subclass procedure is no different from handling these messages in any other wndproc with the exception that you use CallWindowProc for default msg handling.
Regarding wordwrap, you can specify your own wordwrap callback, EditWordProc, and set and get it with EM_SETWORDBREAKPROC and EM_GETWORDBREAKPROC. EM_FMTLINES may be of some interest to you also.