tseph
asked on
CRichEditView OnDraw
I've created an application using app wizard in Visual C++ 5.0. It's a MDI Using CRichEditView as its view class. I want to intercept keyboard messages and modify them before they appear on the screen. I also want to format the text so the line spacing is something other than 1.
2 questions:
Where does the keyboard message handling occure? I can't find it anywhere. I can map an OnKeydown function, but it seems to be called after the message has been processed elsewhere.
Where does the actualy screen drawing occur. If I knew these things, I could customize the application to do what I need.
Thanks.
2 questions:
Where does the keyboard message handling occure? I can't find it anywhere. I can map an OnKeydown function, but it seems to be called after the message has been processed elsewhere.
Where does the actualy screen drawing occur. If I knew these things, I could customize the application to do what I need.
Thanks.
The WM_KEYUP and WM_KEYDOWN (as well as the WM_SYSKEYDOWN, WM_SYSKEYUP) messages are sent to the window with the current "input focus" (a result of windows getting the handle of the window under the cursor). I dont' know if these will help anything. I don't know if these messages are processed somewhere else first.
As for the spacing between letters, you need to make a call to
int CDC::SetTextCharacterExtra (int);
This spacing is added (in form of pixels for MM_TEXT. The other mapping modes either are or need to be converted to pixels) to EVERY character including blanks and will achieve the S p a c i n g E f f e c t.
There's also a
int CDC::GetTextCharacterExtra (); to get the current spacing value.
As for understanding where the screen drawing occurs. I'm not sure if you are referring to which functions are used to update the screen or how to output the text yourself. Either way, it can be a lengthy answer and could be better understood if read in a tutorial or a good book on MFC programming.
As for the spacing between letters, you need to make a call to
int CDC::SetTextCharacterExtra
This spacing is added (in form of pixels for MM_TEXT. The other mapping modes either are or need to be converted to pixels) to EVERY character including blanks and will achieve the S p a c i n g E f f e c t.
There's also a
int CDC::GetTextCharacterExtra
As for understanding where the screen drawing occurs. I'm not sure if you are referring to which functions are used to update the screen or how to output the text yourself. Either way, it can be a lengthy answer and could be better understood if read in a tutorial or a good book on MFC programming.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER