The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Disable the Delphi clipboard history; originally by Attila Kovacs at https://plus.google.com/u/0/108426155215159556558/posts/6MBZuMYDTCD

Posted by jpluimers on 2018/04/07

Delphi Clipboard History

Delphi Clipboard History

[WayBack] Castalia had a Clipboard History for Delphi since a long time and since the acquisition of it around Delphi XE8, that was [Archive.isintegrated into the IDE for everyone to use as the [WayBack] “Delphi Clipboard History

Some people object to the history viewer, for instance:

  • stability reasons
  • security issues

Even though used by a lot of password managers to transfer saved passwords to applications requiring credentials, the clipboard isn’t really a secure place as it is a shared resource that any application can monitor: [WayBackIs a password in the clipboard vulnerable to attacks? – Information Security Stack Exchange.

It’s just that often the clipboard is about the only way to communicate date between two applications.

The real reason to get rid of the clipboard history is that in many Delphi versions it causes trouble with RichEdit controls: [Archive.isCastalia’s Clipboard history + TRichEdit = IDE deadlock | Andy’s Blog and Tools after Eugene Kotlyarov posted a [WayBack] bug issue on G+.

I’m still not sure why Castalia and Delphi include a Clipboard History and even show it by default as:

If you would want to build such a tool (that can hide itself when not needed), then use the free repository at chrisrolliston/CCR.Clipboard: Extended TClipboard implementation for Delphi (FMX and VCL) [Archive.isDitto download | SourceForge.net

At G+, Attila Kovacs published a non-intended version of the below version: [WayBack]

Source: Disable the Delphi clipboard history; originally by Attila Kovacs at https://plus.google.com/u/0/108426155215159556558/posts/6MBZuMYDTCD

–jeroen


unit DisableClipboardHistoryFormUnit;
interface
procedure DisableClipboardHistoryForm;
implementation
uses
System.Classes,
Vcl.Menus,
ToolsAPI;
procedure DisableClipboardHistoryForm;
const
ClipboardHistoryForm = 'ClipboardHistoryForm';
var
i: Integer;
j: Integer;
mi: TMenuItem;
NTAServices: INTAServices;
o: TComponent;
begin
NTAServices := BorlandIDEServices as INTAServices;
for i := 0 to NTAServices.MainMenu.Items.Count – 1 do
begin
mi := NTAServices.MainMenu.Items[i];
for j := 0 to mi.Count – 1 do
begin
if Assigned(mi.Items[j].Action) and //
Assigned(mi.Items[j].Action.Owner) and //
(mi.Items[j].Action.Owner.Name = ClipboardHistoryForm) then
begin
mc := mi.Items[j];
mi.Remove(mc);
mc.Free;
o := Application.FindComponent(ClipboardHistoryForm);
if Assigned(o) then
o.Free;
Break;
end;
end;
end;
end;
end.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.