回复 1# cashiba
笨办法:自己构造一个inputbox#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $if_bt ; 1 代表点击的是确认按钮 2代表点击的是回车
_Temp_InputBox('test','test','test')
If $if_bt = 2 Then
MsgBox(0,'','按了回车')
Else
MsgBox(0,'','没按回车')
EndIf
Func _Temp_InputBox($a,$b,$c)
Local $Form1 = GUICreate($a, 371, 149, 402, 259)
Local $Lable1 = GUICtrlCreateLabel($b, 1, 1, 360, 17)
Local $Input1 = GUICtrlCreateInput($c, 16, 40, 345, 21)
Local $Button1 = GUICtrlCreateButton("确定", 40, 88, 97, 25)
Local $Button2 = GUICtrlCreateButton("cancel", 184, 88, 113, 25)
GUISetState(@SW_SHOW)
HotKeySet('{enter}','_enter')
Local $temp_return = ''
;返回的文字
While 1
Sleep(1)
If $if_bt = 2 Then
$temp_return = GUICtrlRead($Input1)
ExitLoop
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
;按下确定后的函数
$temp_return = GUICtrlRead($Input1)
$if_bt = 1
ExitLoop
Case $Button2
;按下取消
ExitLoop
EndSwitch
WEnd
GUIDelete($Form1)
Return $temp_return
EndFunc
Func _enter()
$if_bt = 2
HotKeySet('{enter}')
EndFunc
|