January 19, 2021, 01:15:57 am


IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!

Puzzled - any ideas?

Started by Andy, July 26, 2020, 04:26:00 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Well I have got all the undo / redo functions working in my rich edit control editor, and it's time to add in those shortcut keyboard functions.

But I am puzzled on this one - does anyone have any ideas / theories...

1. The rich edit control is sub classed.
2. I have mouse right click options for cut / copy / paste.
3. They work correctly.
4. The keyboard shortcut uses the same code as the mouse functions.
5. The "Paste" is doubling up on the code.


1. I cut a line with ENDIF
2. I paste with the mouse.
3. The new line shows ENDIF.

Now using the keyboard:
1. I cut a line with ENDIF (Ctrl + X)
2. I press Ctrl + C.
3. The new line is ENDIFENDIF

Finally I worked out that I need to disable the built in Ctrl + V, because when I change the paste ADDACCELERATOR to Ctrl + T it's okay.

So does anyone know how to disable / remove the built in Ctrl + V for a rich edit control - or better still change what it does in the sub classed handler?

I am not using the IWB @RTCUT command, I copy and delete the highlighted text myself and then delete it.

Help anyone please?

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.


in your subclass procedure msg handler trap the pressing of the Ctrl-C key
something like this
   SELECT uMsg
         SELECT wParam
            CASE VK_C
               IF GetKeyState(VK_CONTROL) THEN   RETURN 0

Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library



It's always a relief when you are stuck and someone lends a hand - thanks!

I was on the right lines and it was only when I realised the problem - a CTRL + X or a CTRL + C sends the selected text to the clip board.

So with this in mind I simply cleared the clip board and used my own large ISTRING (ClipText2 which also holds the selected text) instead - and it works!

Code Select
     IF wParam = 17 'Ctrl Key
        CtrlDown = 0

Code Select
     IF wParam = 17 'Ctrl Key
        CtrlDown = 1

     IF CtrlDown = 1 and wParam = 67 or wParam = 88 'Ctrl + C / X - Copy / Cut
        ClipText2 = CutLine
        CtrlDown = 0
        return 0

w1 is my main window
CtrlDown is a global INT variable
CutLine is another large ISTRING which I use a lot and gets cleared afterwards.


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.