Topic: get clipboard changes

Hi folks,

anyone has an idea on how to get a notification when the clipboard changes?

Re: get clipboard changes

Hello.


Example:

var
    Timer: TTimer;
    BufferValue: string;


procedure Form1_OnShow (Sender: TObject; Action: string);
begin
    BufferValue := ClipboardGet;
    Timer := TTimer.Create(Form1);
    Timer.OnTimer := @OnTimer;
    Timer.Interval := 500;
    Timer.Enabled := True;
end;

procedure Form1_OnClose (Sender: TObject; Action: string);
begin
    Timer.Free;
end;


procedure OnTimer(Sender: TObject);
begin
    if BufferValue <> ClipboardGet then // clipboard has been changed
    begin
        BufferValue := ClipboardGet;
        ShowMessage(ClipboardGet);
    end;
end;


but this is not quite the correct way

Dmitry.

Re: get clipboard changes

Thank you, that was what i was thinking About. Maybe there is a Chance you can implement something like this or maybe the better way in MVD.