修改了一下
窗体中如果有组合框的话,要过滤一下
Opt('GUIOnEventMode', 1)
#AutoIt3Wrapper_Run_Debug_Mode=Y
GUICreate('窗口')
GUISetOnEvent(-3, '_Exit')
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
$Input1 = GUICtrlCreateEdit('这个点击即全选', 50, 50, 200, 20,BitOR($ES_WANTRETURN, $WS_VSCROLL))
$hInput1 = GUICtrlGetHandle(-1)
$Input2 = GUICtrlCreateInput('这个点击即全选', 50, 110, 200, 20)
$hInput2 = GUICtrlGetHandle(-1)
GUICtrlCreateInput('这个不会全选,点哪是哪', 50, 80, 200, 20)
GUISetState()
GUIRegisterMsg(0x0111, 'WM_COMMAND')
;~ GUISetOnEvent($GUI_EVENT_PRIMARYUP, "SpecialEvents")
While 1
Sleep(100)
WEnd
Func SpecialEvents()
$a = GUIGetCursorInfo()
If Not @error And $a<>0 Then
GUICtrlSetState($a[4], 256)
EndIf
EndFunc
Func _Exit()
Exit
EndFunc ;==>_Exit
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
$a = GUIGetCursorInfo()
If Not @error And $a<>0 Then
If $a[2] Then
GUICtrlSetState($a[4], 256)
EndIf
EndIf
EndFunc ;==>WM_COMMAND
|