คือตอนนี้ผมเขียนให้เมื่อกด Checkbox1 โปรแกรมจะกด F10 กับ 2 ผมอยากให้
1. ให้เลือก Checkbox ก่อนแล้วกด Button1 โปรแกรมถึงเริ่มทำงาน
2. อยากจะไห้โปรแกรมหยุดการทำงานโดยกด Button2
มือใหม่จริง ๆ ครับอยากรู้การทำงานของ Checkbox กับ Button
Thank you
1. ให้เลือก Checkbox ก่อนแล้วกด Button1 โปรแกรมถึงเริ่มทำงาน
2. อยากจะไห้โปรแกรมหยุดการทำงานโดยกด Button2
มือใหม่จริง ๆ ครับอยากรู้การทำงานของ Checkbox กับ Button
Thank you
- Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\koda_1.7.3.0\forms\test1.kxf
$Form1 = GUICreate("Test1", 320, 145, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("BUFF Hp", 24, 40, 129, 25)
$Checkbox2 = GUICtrlCreateCheckbox("กดยา Auto", 24, 72, 81, 25)
$Button1 = GUICtrlCreateButton("Start", 160, 32, 129, 33)
$Button2 = GUICtrlCreateButton("Stop", 160, 80, 129, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $GameHD
Func _PSsixLoadH($gtitle)
$GameHD = WinGetHandle($gtitle)
If @error Then
MsgBox(4096, "Error", "ไม่พบหน้าต่างเกม")
Else
Return 1
EndIf
EndFunc
If _PSsixLoadH("Mu") Then WinActivate($GameHD)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox1
While 1
ControlSend($GameHD, "", "", "{F10}")
Sleep(1000)
ControlSend($GameHD, "", "", "2")
Sleep(1000)
WEnd
EndSwitch
WEnd