Thema: ClipBord

Einzelnen Beitrag anzeigen

oldmann

Registriert seit: 10. Okt 2008
Ort: Weyhe
152 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#30

AW: ClipBord

  Alt 29. Nov 2018, 13:14
Hallo KodeZwerg,

Hier ist mehr Code:

Delphi-Quellcode:
procedure TForm1.WMHotKey(var Msg: TWMHotKey);
var fNameBMP, fNameJPG, verz_name:string;
    pic : TImage;
begin
  if Msg.HotKey = id1 then
  begin
    Form4.Filelistbox1.Mask:=Lpf+'Mustertexte\*.txt';
    Form4.Show;
  end;

  if Msg.HotKey = id2 then
  begin
    Clipboard.clear;
    Clipboard.AsText:=Clipboard.AsText+'ews@eberhard-werner.de';
// Form1.PasteFromClipBoard;
  end;
end;

procedure TForm1.WMTASKBAREVENT(var message: TMessage);
var point : TPoint;
begin
    case message.LParamLo of
         WM_LBUTTONDBLCLK : begin
                                 form2.show;
                            end;
         WM_RBUTTONDOWN : begin
                                 GetCursorPos(point);
                                 popupmenu1.popup(point.x,point.y);
                            end;
    end;
end;


procedure TaskBarAddIcon;
var tnid : TNOTIFYICONDATA ;
begin
    tnid.cbSize := sizeof(TNOTIFYICONDATA); // Größenangabe der Struktur
    tnid.Wnd := Form1.handle; // Handle des Message-Empfängers
    tnid.uID := 1; // ID beliebig
    tnid.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP; // siehe Tabelle
    tnid.uCallbackMessage := WM_TASKBAREVENT; // Message# für Form1
    tnid.hIcon := form1.image2.picture.icon.handle; // Iconhandle
    strcopy(tnid.szTip,'Textdateien'); // Tooltiptext
    Shell_NotifyIcon(NIM_ADD, @tnid); // Registrieren ...
end;

procedure TaskBarRemoveIcon;
var tnid : TNOTIFYICONDATA ;
begin
    tnid.cbSize := sizeof(TNOTIFYICONDATA);
    tnid.Wnd := Form1.handle;
    tnid.uID := 1;
    Shell_NotifyIcon(NIM_DELETE, @tnid);
end;


procedure TForm1.FormCreate(Sender: TObject);
const
  MOD_ALT = 1;
  MOD_CONTROL = 2;
  MOD_SHIFT = 4;
  MOD_WIN = 8;
  VK_A = $41;
  VK_R = $52;
  VK_F4 = $73;
  VK_T = $54;
  VK_E = $45;
  VK_0 = $30;
  VK_1 = $31;
  VK_2 = $32;
  VK_3 = $33;
  VK_4 = $34;
  VK_5 = $35;
  VK_6 = $36;
  VK_7 = $37;
  VK_8 = $38;
  VK_9 = $39;
begin
  // Register Hotkey Ctrl + T
  id1 := GlobalAddAtom('Hotkey1');
  RegisterHotKey(Handle, id1, MOD_CONTROL, VK_T);
  ShowWindow(GetWindow(handle,GW_OWNER),SW_HIDE);

  id2 := GlobalAddAtom('Hotkey2');
  RegisterHotKey(Handle, id2, MOD_CONTROL, VK_E);

 end;
oldmann
  Mit Zitat antworten Zitat