請問1這段代碼如何讓BACK鍵可對INPUT1鍵SEND返回鍵用好久搞不定
2如何用窗口托放選取CASE $Button19寫入的檔案…謝謝
#include <GUIConstants.au3>
#include <file.au3>
#NoTrayIcon
#include "misc.au3"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("強", 285, 681, 428, 22)
$Button1 = GUICtrlCreateButton("1", 32, 384, 51, 25, 0)
$Input1 = GUICtrlCreateInput("", 32, 592, 150, 30)
$Input=GUICtrlSetFont(-1, 15, 1000, "")
$Button2 = GUICtrlCreateButton("2", 88, 384, 51, 25, 0)
$Button3 = GUICtrlCreateButton("3", 144, 384, 51, 25, 0)
$Button4 = GUICtrlCreateButton("4", 200, 384, 51, 25, 0)
$Button5 = GUICtrlCreateButton("5", 32, 416, 51, 25, 0)
$Button6 = GUICtrlCreateButton("6", 88, 416, 51, 25, 0)
$Button7 = GUICtrlCreateButton("7", 144, 416, 51, 25, 0)
$Button8 = GUICtrlCreateButton("8", 200, 416, 51, 25, 0)
$Button9 = GUICtrlCreateButton("9", 32, 448, 51, 25, 0)
$Button10 = GUICtrlCreateButton("A", 32, 488, 51, 25, 0)
$Button11 = GUICtrlCreateButton("B", 88, 488, 51, 25, 0)
$Button12 = GUICtrlCreateButton("C", 144, 488, 51, 25, 0)
$Button13 = GUICtrlCreateButton("D", 32, 520, 51, 25, 0)
$Button14 = GUICtrlCreateButton("E", 88, 520, 51, 25, 0)
$Button15 = GUICtrlCreateButton("F", 144, 520, 51, 25, 0)
$Button16 = GUICtrlCreateButton("0", 32, 352, 51, 25, 0)
$Button17 = GUICtrlCreateButton("BACK", 180, 592, 51, 25, 0)
$Button18 = GUICtrlCreateButton("讀取MAC", 32, 624, 59, 25, 0)
$Button19 = GUICtrlCreateButton("寫入", 104, 624, 67, 25, 0)
$Group1 = GUICtrlCreateGroup("小鍵盤", 16, 328, 257, 241)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input3 = GUICtrlCreateInput("待開發", 16, 264, 121, 21)
$Button23 = GUICtrlCreateButton("。。", 144, 264, 35, 25, 0)
$Button20 = GUICtrlCreateButton("槍查版本", 216, 168, 75, 41, 0)
$Button21 = GUICtrlCreateButton("BRINGE", 216, 112, 83, 41, 0)
$Group2 = GUICtrlCreateGroup("檢查", 184, 88, 105, 145)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input2 = GUICtrlCreateInput("ated", 32, 120, 121, 21)
$Button22 = GUICtrlCreateButton("QA", 32, 168, 123, 41, 0)
$Group3 = GUICtrlCreateGroup("QA", 16, 88, 161, 145)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Edit1 = GUICtrlCreateEdit("", 16, 16, 249, 65)
GUICtrlSetData(-1, "燒完先檢查MODE在檢查版本")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button18
$sIP =(@IPAddress1)
$sIP="10.10.10.254"
;$sIP="192.168.1.100"
$MAC = _GetMAC ($sIP)
If $MAC <> "00:00:00:00:00:00" Then
$MAC = GUICtrlSetData($Input1,$MAC)
$MAC=GUICtrlSetFont(-1, 15, 1000, "")
EndIf
case $Button19
_FileCreate("E:\2341燒分位&MAC用\address")
$a=GUICtrlRead($Input1)
FileWrite("E:\2341燒分位&MAC用\address",$a)
case $Button16
GUICtrlSetData($Input1,"0","$Input1")
case $Button1
GUICtrlSetData($Input1,"1","$Input1")
case $Button2
GUICtrlSetData($Input1,"2","$Input1")
case $Button3
GUICtrlSetData($Input1,"3","$Input1")
case $Button4
GUICtrlSetData($Input1,"4","$Input1")
case $Button5
GUICtrlSetData($Input1,"5","$Input1")
case $Button6
GUICtrlSetData($Input1,"6","$Input1")
case $Button7
GUICtrlSetData($Input1,"7","$Input1")
case $Button8
GUICtrlSetData($Input1,"8","$Input1")
case $Button9
GUICtrlSetData($Input1,"9","$Input1")
case $Button10
GUICtrlSetData($Input1,"A","$Input1")
case $Button11
GUICtrlSetData($Input1,"B","$Input1")
case $Button12
GUICtrlSetData($Input1,"C","$Input1")
case $Button13
GUICtrlSetData($Input1,"D","$Input1")
case $Button14
GUICtrlSetData($Input1,"E","$Input1")
case $Button15
GUICtrlSetData($Input1,"F","$Input1")
case $Button17
Send("")
;$a = ControlGetFocus("強")
;send("{BS}")
Opt("MouseCoordMode", 0)
;MouseMove(175,600)
;MouseClick("left")
send("{BACKSPACE}")
;GUICtrlSetOnEvent ($Input1 , "{BACKSPACE}" )
;========================================================================
CASE $Button20
Opt("MouseCoordMode", 2)
MouseMove(350,200)
MouseClick("left")
send("{tab}")
send("{tab}")
send("{tab}")
send("{tab}")
send("{enter}")
CASE $Button21
Opt("MouseCoordMode", 2)
MouseMove(350,140)
MouseClick("left")
case $Button22
RUN("E:\QA_RT2880_V1_4_0_8\RT2880QA.exe")
WinWaitActive("RT2880 QA")
SEND("{PGDN}")
ControlClick("RT2880 QA","OK","Button1")
EndSwitch
WEnd
Func _GetMAC ($sIP)
Local $MAC;,$MACSize
Local $i,$s,$r,$iIP
$MAC = DllStructCreate("byte[6]")
$MACSize = DllStructCreate("int")
DllStructSetData($MACSize,1,6)
$r = DllCall ("Ws2_32.dll", "int", "inet_addr", "str", $sIP)
$iIP = $r[0]
$r = DllCall ("iphlpapi.dll", "int", "SendARP","int", $iIP,"int", 0,"ptr", DllStructGetPtr($MAC),"ptr", DllStructGetPtr($MACSize))
$s = ""
For $i = 0 To 5
If $i Then $s = $s & ""
$s = $s & Hex(DllStructGetData($MAC,1,$i+1),2)
Next
Return $s
EndFunc |