Key Buffer Problem ATL Windows RichEdit Control Control 
Author Message
 Key Buffer Problem ATL Windows RichEdit Control Control

Hi,
   I have developed  ATL windows control  by Superclassing
RichEdit20.dll
I have implemented all methods and events requied for a normal
Richedit Control. To make the control compatible with Microsoft's
RichTextBox I have developed an adapter OCX by using the ATL RichEdit
Control.

Now in a normal MS RichText Box if the user does not need a keyevent,
he/she can set the Keycode parameter to zero.
Consider the following code in VB:
   Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As
Integer)
        If KeyCode <> vbKeyMenu And Shift = 4 Then KeyCode = 0
   End Sub
This code is used to prevent user from typing special characters using
ALT & num key combinations, e.g. ALT + 0169 = ?
In above case if user types ALT + 0169 nothing gets printed on the MS
TextBox.
Now if I follow the above action and type character "A" then it gets
printed on the MS TextBox.

To simulate the KeyCode = 0 effect I  have implemented a logic that
skips the default KeyHandler function if the user sets KeyCode=0,there
by not allowing the key to be printed on to my control. This works
fine. But when I implement  the above mentioned case, the behavior is
similar upto the point that the ALT + 0169 is not printed. Now if I
type character "A",instead of "A" appearing on the control, "?"
appears.
It seems the ? character is not removed from the KeyBuffer.
Can any one please explain the behavior and suggest a remedy for it.
Hope I have defined the problem properly.

Thanks in advance,
regards,
Rahul



Wed, 20 Oct 2004 16:51:15 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. richedit control and edit control problem

2. TAB key, controls and child windows with controls

3. ATL Control with intrinsic Windows controls

4. short cut keys for RichEdit Control

5. Standard Windows Controls in ATL Composite Control

6. How do I intercept the cntl-insert or cntl-v (paste) key in a richedit control

7. How do I intercept the cntl-insert or cntl-v (paste) key in a richedit control

8. Richedit based ATL control crashes.

9. Problem with scripting ATL 7.0 ActiveX Control under Windows 98

10. ATL Full Control - mouse activation problems in Composite Control

11. ATL Full Control - mouse activation problems in Composite Control

12. Help - Problems with Drawing an MFC ActiveX control inside on ATL compsoite control

 

 
Powered by phpBB® Forum Software