Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.01.01;
Скачать: CL | DM;

Вниз

clipboard   Найти похожие ветки 

 
snake77   (2005-12-14 10:29) [0]

Здравствуйте!
подскажите как сделать опрос clipboard на наличие в нем какой бы то нибыло информации. Япопробовал сделать в цикле, но при этом сильно грузится машина.
Я так понимаю что надо делать событийно, т.е. при появлении чегото в клибоарде должна вызываться процедурка.
у TClipboard нет эвентов, хук тоже ненайду
:(


 
Rouse_ ©   (2005-12-14 10:49) [1]

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
 Dialogs;

type
 TForm1 = class(TForm)
   procedure FormCreate(Sender: TObject);
   procedure FormDestroy(Sender: TObject);
 private
   hwndNextViewer: THandle;
   procedure WMChangeCbChain(var Message: TWMChangeCBChain); message WM_CHANGECBCHAIN;
   procedure WMDrawClipboard(var Message: TMessage); message WM_DRAWCLIPBOARD;
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
 // Add the window to the clipboard viewer chain.
 hwndNextViewer := SetClipboardViewer(Handle);
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.
 with Message do
   SendMessage(hwndNextViewer, Msg, WParam, LParam);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
 ChangeClipboardChain(Handle, hwndNextViewer);
end;

end.



Страницы: 1 вся ветка

Текущий архив: 2006.01.01;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.046 c
2-1134300322
ЕвгенийГость
2005-12-11 14:25
2006.01.01
Пожалуйста, напомните как обрабатывать нажатия клавиш... особенно


14-1134311456
Иван Петрович
2005-12-11 17:30
2006.01.01
Вопрос наверно лмера)


14-1134186110
Alexe_y
2005-12-10 06:41
2006.01.01
Vb.net и delphi


2-1134727704
Goast
2005-12-16 13:08
2006.01.01
Проблема с CoolTrayIcon


14-1134032877
Delphi77
2005-12-08 12:07
2006.01.01
Помогите с программой использующию Генератор отчетов ReportSmith