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) =-32767) then
begin
// int ClickL = GetPrivateProfileInt("EC-CLICK","ClickL",0,GPHINI);
if(ClickL = 0) then
begin
//WritePrivateProfileString("EC-CLICK","ClickL","1",GPHINI);
SendMessageA(hJanela, WM_LBUTTONDOWN,VK_F7, MK_LBUTTON);
SendMessageA(hJanela, WM_RBUTTONUP,VK_F7, MK_RBUTTON);
//ClientMsgStringSend("","[EquipeCrazzY] Ativando autoclick Esquerdo", 0x2);
end;
if(ClickL = 1) then
begin
//WritePrivateProfileString("EC-CLICK","ClickL","0",GPHINI);
//ClientMsgStringSend("","[EquipeCrazzY] Desativando autoclick Esquerdo", 0x2);
SendMessageA(hJanela, WM_LBUTTONUP,VK_F7, MK_LBUTTON);
end
else
{Ativar e desativar Butao do Direito}
if (GetAsyncKeyState(VK_F8) =-32767) then
begin
//int ClickR = GetPrivateProfileInt("EC-CLICK","ClickR",0,GPHINI);
if(ClickR = 0) then
begin
//WritePrivateProfileString("EC-CLICK","ClickR","1",GPHINI);
SendMessageA(hJanela, WM_RBUTTONDOWN,VK_F8, MK_RBUTTON);
SendMessageA(hJanela, WM_LBUTTONUP,VK_F8, MK_LBUTTON);
//ClientMsgStringSend("","[EquipeCrazzY] Ativando autoclick direito", 0x2);
end;
if(ClickR = 1) then
begin
//WritePrivateProfileString("EC-CLICK","ClickR","0",GPHINI);
//ClientMsgStringSend("","[EquipeCrazzY] Desativando autoclick direito", 0x2);
SendMessageA(hJanela, WM_RBUTTONUP,VK_F8, MK_RBUTTON);
end;
end;
end;
end;
end;
procedure StartAutoClick(Inicializer: Pointer);
var
xlinha: string;
Label GoToLabel;
begin
GoToLabel :
Sleep(100);
EC_AutoClick();
GoTo GoToLabel;
end;
procedure DLLMain(Reason: DWORD);
var
ThreadId : DWORD;
begin
case Reason of
DLL_PROCESS_ATTACH:
begin
CreateThread(nil, 0, @StartAutoClick, Pointer(nil), 0, ThreadId);
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.