Global $tHooksend, $_Auto_Timer = 1000
Global $_Auto_hTimerProc = DllCallbackRegister('_Auto', 'none', 'hwnd;uint;uint_ptr;dword')
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($Win, 330, 260, 193, 125)
$Button1 = GUICtrlCreateButton("取PID", 56, 24, 75, 25, 0)
$Button2 = GUICtrlCreateButton("吃红", 56, 80, 75, 25, 0)
$Button3 = GUICtrlCreateButton("吃蓝", 56, 112, 75, 25, 0)
$Button4 = GUICtrlCreateButton("回城", 176, 80, 75, 25, 0)
$Button5 = GUICtrlCreateButton("冰系", 56, 160, 75, 25, 0)
$Button6 = GUICtrlCreateButton("火系", 176, 160, 75, 25, 0)
$Button7 = GUICtrlCreateButton("打开", 176, 24, 75, 25, 0)
$Button8 = GUICtrlCreateButton("自动", 56, 190, 75, 25, 0)
$Button9 = GUICtrlCreateButton("停止", 176, 190, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If IsDllStruct($tHooksend) Then _RTApiUnhook($w_Handle, $pSend, DllStructGetData($tHooksend, 'Entrypoint')) ;卸载钩子
_WinAPI_KillTimer(0, $_Auto_Timer)
DllCallbackFree($_Auto_hTimerProc)
If $w_Handle <> 0 Then _WinAPI_CloseHandle($w_Handle) ;关闭进程句柄
AsmExit($Asm) ;释放ASM模块
Exit
Case $Button1
$Hawd = WinGetHandle($Name) ;取窗口句柄
If $Hawd <> 0 Then
GetWindowThreadProcessId($Hawd, $pid) ;取窗口进程PID
$w_Handle = OpenProcess($pid) ;打开进程句柄
If $w_Handle = 0 Then
MsgBox(0, $Win, "打不开进程")
Else
$tHooksend = _RTApiHookEx($w_Handle, $pSend, 4, $pCallBack, $APIHOOK_Flags_Default) ;挂钩hook send函数
MsgBox(0, "取窗口ID", "窗口句柄:" & $Hawd & " 窗口PID:" & $pid & " 打开进程:" & $w_Handle)
EndIf
Else
MsgBox(0, $Win, "窗口《游戏找CALL练习实例one》不存在!")
EndIf
Case $Button2
If $Hawd <> 0 Then _Send(0x00453028) ;;传参,调用CALL
Case $Button3
If $Hawd <> 0 Then _Send(0x00453040)
Case $Button4
If $Hawd <> 0 Then _Send(0x0045305C) ;;传参,调用CALL
Case $Button5
If $Hawd <> 0 Then _SendGj(0x0045307C, 1) ;;传参,调用CALL
Case $Button6
If $Hawd <> 0 Then _SendGj(0x0045309C, 2) ;;传参,调用CALL
Case $Button7
If ProcessExists("游戏找CALL练习实例one.exe") = 0 Then Run("游戏找CALL练习实例one.exe")
Case $Button8
$_Auto_Timer = _WinAPI_SetTimer(0, $_Auto_Timer, 3000, DllCallbackGetPtr($_Auto_hTimerProc))
Case $Button9
_WinAPI_KillTimer(0, $_Auto_Timer)
EndSwitch
WEnd
;自动
Func _Auto($hWnd, $iMsg, $iTimerId, $iTime)
_Send(0x00453028)
EndFunc ;==>_Auto