Fórum executavel minimizado ou em 2° plano fica em 1° plano via codigo como? #402967

14/06/2011

0

Já tentei de várias maneiras, a última segue no código abaixo, mas está dando um erro na compilação. Ajudem por favor.   procedure TForm1.ativaclickClick(Sender: TObject);
var
Mouse1 :integer;
Mouse2 :integer;
Pt : TPoint;
hlp: TForm; begin
  hlp := TForm.Create(nil);
  try
    hlp.BorderStyle := bsNone;
    hlp.SetBounds(0, 0, 1, 1);
    hlp.FormStyle := fsStayOnTop;
    hlp.Show;
    mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
      SetForegroundWindow(hwnd); ------------------->>>>>ERRO AKI
(     [Error] Unit1.pas(425): '(' expected but ')' found
      [Error] Unit1.pas(427): ')' expected but identifier 'hlp' found
      [Error] Unit1.pas(428): EXCEPT or FINALLY expected
      [Fatal Error] UWebClick.dpr(5): Could not compile used unit 'Unit1.pas'   )     finally
    hlp.Free;
  end;
//end; begin
  Mouse1:=strtoint(Mouse1txt.Text);//convertendo string para inteiro
  Mouse2:=strtoint(Mouse2txt.Text);//convertendo string para inteiro
  Application.ProcessMessages;
  Pt.x := Mouse1;
  Pt.y := Mouse2 - 20;
  Pt := ClientToScreen(Pt);
  Pt.x := Round(Pt.x * (65535 / Screen.Width));
  Pt.y := Round(Pt.y * (65535 / Screen.Height));
  Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_MOVE, Pt.x, Pt.y, 0, 0);
  Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, Pt.x, Pt.y, 0, 0);
  Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, Pt.x, Pt.y, 0, 0);
  PlaySound('C:\Windows\Media\chord.wav', 1, SND_ASYNC);
  denovo.Enabled := true;
end;
end;
Erick Santos

Erick Santos

Responder

Posts

14/06/2011

Rafael Mattos

tenta assim

   WindowState := wsMinimized;
   WindowState := wsNormal;
   Application.ProcessMessages;


ou


Application.Restore;


Application.BringToFront;
 Application.ProcessMessages;

Responder

Gostei + 0

03/07/2011

Erick Santos

RESOLVIDO, muito obrigado!
Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar