Ir para conteúdo
Fórum Script Brasil
  • 0

botões auto executavel


junix

Pergunta

unit Auto_click;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,ShellAPI, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Timer2: TTimer;
    btn1: TButton;
    btn2: TButton;
    Label1: TLabel;
    Timer3: TTimer;
    procedure btn1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure btn2Click(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer3Timer(Sender: TObject);
  


  private
    { Private declarations }
  public
    { Public declarations }
    end;


var
  Form1: TForm1;


implementation

{$R *.dfm}





procedure TForm1.btn1Click(Sender: TObject);
begin
Timer1.Enabled :=true

end;
 procedure TForm1.Timer1Timer(Sender: TObject);
begin
btn1.Click
end;

procedure TForm1.btn2Click(Sender: TObject);
begin
Timer2.Enabled :=true
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
btn2.Click
end;

procedure TForm1.Timer3Timer(Sender: TObject);
var
 WND: HWND;
  ProcessId: DWORD;
  BytesWritten: DWORD;
  hProcess: THandle;
  i: Integer;
  Write: DWORD;
begin
 WND := FindWindow('BlaBla', nil);
  Write := 0;

  if WND <> 0 then
  begin
    GetWindowThreadProcessId(WND, @ProcessId);

    hProcess := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);
    try
      if hProcess = INVALID_HANDLE_VALUE then begin
        raise Exception.Create('Invalid Handle');
        exit;
      end;
finally
CloseHandle(hProcess);
Timer3.Enabled := False;

end;
end.

erro q esta dando é esse :

[erro] Auto_click.pas(91): Record,object or class type required

[erro]Auto_click.pas(94): 'END' expected but endo of file found

[Fatal_error]P_auto_click(5):could not compile used unit'Auto_click.pas'

alguém pode me ajudar agradeço= ]

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Reveja esta parte do código:

procedure TForm1.Timer3Timer(Sender: TObject);
var
WND: HWND;
  ProcessId: DWORD;
  BytesWritten: DWORD;
  hProcess: THandle;
  i: Integer;
  Write: DWORD;
begin
  WND := FindWindow('BlaBla', nil);
  Write := 0;

  if WND <> 0 then
  begin
    GetWindowThreadProcessId(WND, @ProcessId);

    hProcess := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);

    try
      if hProcess = INVALID_HANDLE_VALUE then
         begin
            raise Exception.Create('Invalid Handle');
            exit;
         end;
    finally
       CloseHandle(hProcess);
       Timer3.Enabled := False;
    end;

  end;
end;

end.

abraço

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...