Clipboard actions to multiple controls and types : How? lazarus / 21-General ---------------------------------------------------------------------- zxandris · 2025-04-26 02:16 Okay, here's my issue.  I've set up an action hooked to CTRL+V, for instance, for paste, which will now only paste into a memo.  But there are multiple controls on that form that I would like to paste with the shortcut key.  Now, outside of using ActiveControl and checking every name, is there a way I can paste to any viable control that is focused? This is something I would love to be able to do with any of the clipboard actions, and potentially others, too.  Is there a nice way of doing this? Can I, cast to a class that won't crash for any TEdit, TMemo, TSynEdit, and File edit controls and trigger its built-in action.  This is one for the knowledgeable here, I think. Thanks in advance, CJ ---------------------------------------------------------------------- jamie · 2025-04-26 09:29 Lookup WM_PASTE mrssage and related ---------------------------------------------------------------------- cdbc · 2025-04-26 10:13 Hi Remove your 'Ctrl+V'-action and let the controls handle it themselves...?!? Regards Benny ---------------------------------------------------------------------- zxandris · 2025-04-26 12:48 Okay thanks people for replying. Thanks "jamie" I went searching on WM_Paste and it provided the solutions to my woes or rather https://dsiders.gitlab.io/lazdocsnext/lcl/lclintf/sendmessage.html did. I couldn't just let the controls handle themselves for that action or rather remove my shortkey because I have special handling so what I did in the end was check ActiveControls name field for my three specials, or rather it wasn't then and instead I :- Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      if ActiveControl<>nil then     begin          try             if (ActiveControl.Name<>'memEdit') and (ActiveControl.Name<>'synEdit') and (ActiveControl.Name<>'lvList') then             begin                SendMessage(ActiveControl.Handle, WM_Paste, 0, 0)             end else             begin                 // Special             end;       except            // Error Handling         end;end;  Basically rather cut down that's what I did.  Feels oddly clunky but it does work.  For anyone that is in a similar situation that was the solution thanks to those above this message. Thank you! CJ