Results 1 to 2 of 2

Thread: WM_CONTEXTMENU vs. RichTextBox and InkEdit

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    WM_CONTEXTMENU vs. RichTextBox and InkEdit

    I was fiddling with Windows SpellCheck in InkEdit controls, and I ran into trouble with having both right-click SpellCheck correction and "normal" editing menus (cut, paste, bold, etc.) work for the same InkEdit.

    Then I realized most of our common silly code catching MouseDown events is in error anyway and we really ought to handle "menu" button presses (both the special Windows Menu key on newer keyboards and the Shift-F10 combination) as well.

    But... subclassing the RTF controls for WM_CONTEXTMENU only works for the keys and not right-clicks! I'm not sure but it might be something within RichEdit, possibly related to:

    Q245754: BUG: Windows 2000 RichEdit Control Generates WM_CONTEXTMENU Message

    ... though that would suggest the opposite problem. I guess I'm wondering if these controls are trying to compensate for that "bug."


    Setting aside SpellCheck for the moment, I created a test Project with a RichTextBox and a TextBox on a Form:

    • Both the keystrokes and mouse right-click work for the TextBox.
    • Only the keystrokes work for the RichTextBox.


    Anyone have a clue?


    [BTW: Test in the IDE to see the Debug.Print results]
    Attached Files Attached Files
    Last edited by dilettante; Jun 16th, 2021 at 08:44 PM.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: WM_CONTEXTMENU vs. RichTextBox and InkEdit

    I think I have the basics resolved. Once I work to see how my solution interacts with SpellCheck I may post the code and mark this resolved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width