Tá ai o código convertido para Delphi só no ponto de compilar a DLL, só lembrando que eu não testei.


Código PHP:
procedure EC_AutoClick;
var
hJanela HWND
ClickL,ClickR Integer;  // Aqui pode ser um tipo Integer ou string para ler do arquivo .INI
begin
  
While true do begin
  
{Ativar e desativar butao Esquerdo}
  
  
hJanela := FindWindow('Form1',nil); //-----Nome da janela do Main
  
if (GetAsyncKeyState(VK_F7) =-32767then
  begin
// int ClickL = GetPrivateProfileInt("EC-CLICK","ClickL",0,GPHINI);
if(ClickL 0then
begin
//WritePrivateProfileString("EC-CLICK","ClickL","1",GPHINI);
SendMessageA(hJanelaWM_LBUTTONDOWN,VK_F7MK_LBUTTON);
SendMessageA(hJanelaWM_RBUTTONUP,VK_F7MK_RBUTTON);
//ClientMsgStringSend("","[EquipeCrazzY] Ativando autoclick Esquerdo", 0x2);
end;

if(
ClickL 1then
begin
//WritePrivateProfileString("EC-CLICK","ClickL","0",GPHINI);
//ClientMsgStringSend("","[EquipeCrazzY] Desativando autoclick Esquerdo", 0x2);
SendMessageA(hJanelaWM_LBUTTONUP,VK_F7MK_LBUTTON);
end
else
{
Ativar e desativar Butao do Direito}
if (
GetAsyncKeyState(VK_F8) =-32767then
  begin
  
//int ClickR = GetPrivateProfileInt("EC-CLICK","ClickR",0,GPHINI);
if(ClickR 0then
begin
  
//WritePrivateProfileString("EC-CLICK","ClickR","1",GPHINI);
   
SendMessageA(hJanelaWM_RBUTTONDOWN,VK_F8MK_RBUTTON);
   
SendMessageA(hJanelaWM_LBUTTONUP,VK_F8MK_LBUTTON);
  
//ClientMsgStringSend("","[EquipeCrazzY] Ativando autoclick direito", 0x2);
end;
if(
ClickR 1then
begin
    
//WritePrivateProfileString("EC-CLICK","ClickR","0",GPHINI);
    //ClientMsgStringSend("","[EquipeCrazzY] Desativando autoclick direito", 0x2);
     
SendMessageA(hJanelaWM_RBUTTONUP,VK_F8MK_RBUTTON);
    
end;
   
end;
  
end;
 
end;
end;
procedure StartAutoClick(InicializerPointer);
var
   
xlinhastring;
   
Label GoToLabel;
begin
        GoToLabel 
:
        
Sleep(100);
        
EC_AutoClick();
        GoTo 
GoToLabel;
end;

procedure DLLMain(ReasonDWORD);
var
   
ThreadId DWORD;
begin
 
case Reason of
   DLL_PROCESS_ATTACH
:
      
begin
         CreateThread
(nil0, @StartAutoClickPointer(nil), 0ThreadId);
      
end;
   
DLL_THREAD_ATTACH:  ;
   
DLL_THREAD_DETACH:  ;
   
DLL_PROCESS_DETACH: ;
 
end;
end;
// API iGHS
procedure iGHS;
begin
// bla bla bla
end;
exports iGHS name 'iGHS';

begin
   DisableThreadLibraryCalls
(hInstance);
   
DllProc := @DllEntryPoint;
   
DllEntryPoint(DLL_PROCESS_ATTACH);
end