tuşlar etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
tuşlar etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

17 Ağustos 2011 Çarşamba

Button üzerine çok satırlı yazı yazma


procedure TForm1.Button1Click(Sender: TObject);
  var i : integer;
begin
  i:=GetWindowLong(Button1.Handle,GWL_STYLE );
  SetWindowLong (Button1.Handle,GWL_STYLE , i or BS_MULTILINE);
  Button1.Caption := 'sat?r1'#13#10'sat?r2';
  end;

Ayın hangi günü


procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(DateToStr(LastDayOfCurrentMonth));
end;ND.COM /C DIR *.*', SW_SHOWNORMAL);

Arka planda çalışan uygulamaya POSTMESSAGE ile tuş gönderme-01


I := 71
SendKeys('Prg. Caption', [VK_Menu, I]);
function SendKeys(ClassOrCaption:PChar;Keys:array of Integer):Boolean;
var
hW:HWND;
Ix:Integer;
begin
Application.ProcessMessages;
hW:=FindWindow(ClassOrCaption,nil);
if hW<=0 then hW:=FindWindow(nil,ClassOrCaption);
Result:=hW>0;
if Result then begin
Result:=SetForeGroundWindow(hW);
if not Result then Exit;
for Ix:=0 to High(Keys) do KeyBd_Event(Keys[Ix], 0, 0, 0);
for Ix:=High(Keys) downto 0 do Keybd_Event(Keys[Ix], 0, KEYEVENTF_KEYUP, 0);
end;
ActivateWindow(Application.Handle);
end;

ARKA PLANDA CALISAN BIR UYGULAMAYA POSTMESSAGE ILE TUS GONDERME-02
procedure TForm1.Button1Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow(nil, 'Main Form Caption');
if h <> 0 then PostMessage(h, WM_KEYDOWN, 65,0);
end;