procedure TForm1.FormCreate(Sender: TObject);
begin
// Add the window to the clipboard viewer chain.
hwndNextViewer := SetClipboardViewer(Handle);
Memo1.Lines.Clear
end;
procedure TForm1.WMChangeCbChain(var Message: TWMChangeCBChain);
begin
with Message do
begin
// If the next window is closing, repair the chain.
if Remove = hwndNextViewer then
hwndNextViewer := Next
// Otherwise, pass the message to the next link.
else
if hwndNextViewer <> 0 then
SendMessage(hwndNextViewer, Msg, Remove, Next);
end;
end;
// clipboard contents changed.
procedure TForm1.WMDrawClipboard(var Message: TMessage);
begin
// Pass the message to the next window in clipboard
// viewer chain.
Memo1.Lines.Add('Сhanged');
with Message do
SendMessage(hwndNextViewer, Msg, WParam, LParam);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
ChangeClipboardChain(Handle, hwndNextViewer);
end;
Статья Контроль за изменением содержимого буфера обмена раздела ОС и Железо Буфер обмена может быть полезна для разработчиков на Delphi и FreePascal.
Комментарии и вопросы
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.