views:

101

answers:

1

Hi, I've developed an Outlook 2003 plug-in that attaches itself to a message compose window. It's a VSTO plug-in written in C# on .Net 3.0 using VS 2008.

Visually, the plug-in adds an extra rich text box and a few other controls(mostly text formatting for the Rich Text Box) to the bottom of the Outlook compose window.

The issue that I am having is that certain keystrokes are being "hijacked" from from the Rich Text box (which has focus) and being responded to by the main compose text area. I have isolated the following details:

  1. Text entry occurs normally.
  2. Backspace, Delete, left and right arrow keys (and possibly others) are "hijacked" and cause the appropriate effect in the MAIN compose area. Focus remains on my Rich Text control.
    3.Spy++ reports that the Rich Text Box receives a WM_KEYDOWN and a WM_KEYUP event, but the event handler for the Rich Text Box only shows a WM_KEYUP.
  3. If another text entry area on the main compose window is selected before selecting my Rich Text Box, then my rich text Box functions normally (and incidentally, receives a WM_CHAR event when Backspace is pressed, in addition to the WM_KEYDOWN and WM_KEYUP)
  4. This ONLY occurs when the composer is in HTML compose mode, and does not occur when the composer is set to compose either Rich Text or Plain text.
  5. the Main compose text area is NOT receiving the WM_CHAR, WM_KEYUP or WM_KEYDOWN events even though it is apparently responding to them.

I found a similar thread on this forum which was somehwhat informative, but his solution did not work for me:
http://stackoverflow.com/questions/977779/wpf-textbox-not-accepting-delete-key

I was able to extend the Compose Window's WndProc, but was not able to intercept any messages at that level that were relevant to the problem I was having.

The behavior I have seen suggests that this is a bug in the InProc HTML composer, which apparently is some IE provided control. Any help resolving this would be very much appreciated.

A: 

I might know what this is, since I encountered it myself and it drove me completely nuts for weeks. Check out this link: SQL Prompt follies.

It may not be your issue, but worth a shot.

AngryHacker
Thanks, this is interesting, I will check and see if SQL Prompt might be involved, but I don't think I'm using that. It seems like the keyboard stream is being manipulated from within the program itself...
Michael