ok, angeschaut -> abgeschrieben -> geht
Delphi-Quellcode:
TfMain =
class(TForm)
private
hNextViewer: DWORD;
protected
procedure WMChangeCBChain(
var Msg: TMessage);
message WM_CHANGECBCHAIN;
procedure WMDrawClipboard(
var Msg: TMessage);
message WM_DRAWCLIPBOARD;
end;
// FormCreate:
hNextViewer := SetClipBoardViewer(
Handle);
// FormDestroy:
ChangeClipBoardChain(
Handle, hNextViewer);
procedure TfMain.WMChangeCBChain(
var Msg: TMessage);
begin
if Msg.WParam = hNextViewer
then
hNextViewer := Msg.lParam
else if hNextViewer <> 0
then
SendMessage(hNextViewer, MSG.Msg, MSG.wParam, MSG.lParam);
end;
procedure TfMain.WMDrawClipboard(
var Msg: TMessage);
var
hClipbrdObj: THandle;
pClipbrdObj: Pointer;
begin
OpenClipboard(
Handle);
hClipbrdObj := GetClipboardData(CF_TEXT);
if hClipbrdObj <> 0
then
begin
pClipbrdObj := GlobalLock(hClipbrdObj);
if chk1.Checked
then
ClipboardChanged(PChar(pClipbrdObj));
end;
GlobalUnlock(DWORD(pClipbrdObj));
GlobalFree(hClipbrdObj);
CloseClipBoard;
end;
Thx @ all (und besonders an Luckie^^)