|
本帖最后由 anchie 于 2010-9-1 11:18 编辑
本来是要写个星号查看器
可是到了这一关获取edit控件文本就堵住了脚
希望高手能出手帮我度过这个难关
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode",1)
$xhtitle = GUICreate("获取控件文本", 281, 109, -1, -1)
$xianshixh = GUICtrlCreateInput("", 16, 16, 249, 21)
$Ckzd = GUICtrlCreateCheckbox("窗口置顶", 16, 48, 73, 17)
GUICtrlSetState($Ckzd,$GUI_CHECKED)
WinSetOnTop($xhtitle,"",1)
$Cktm = GUICtrlCreateCheckbox("窗口透明", 104, 48, 73, 17)
$Starting = GUICtrlCreateButton("开始", 112, 72, 75, 25)
$fanhuiform = GUICtrlCreateButton("返回", 192, 72, 75, 25)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE,"_XH")
GUICtrlSetOnEvent($Ckzd,"_ckzd")
GUICtrlSetOnEvent($Cktm,"_cktm")
GUICtrlSetOnEvent($Starting,"_starting")
GUICtrlSetOnEvent($fanhuiform,"_xh")
While 1
Sleep(500)
WEnd
Func _xh()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE,$fanhuiform
Exit
EndSwitch
EndFunc
Func _ckzd()
While 1
If GUICtrlRead($Ckzd) = $GUI_CHECKED Then
WinSetOnTop($xhtitle,"",1)
ElseIf GUICtrlRead($Ckzd) = $GUI_UNCHECKED Then
WinSetOnTop($xhtitle,"",0)
EndIf
ExitLoop
WEnd
EndFunc
Func _cktm()
While 1
If GUICtrlRead($Cktm) = $GUI_CHECKED Then
WinSetTrans($xhtitle,"",120)
ElseIf GUICtrlRead($Cktm) = $GUI_UNCHECKED Then
WinSetTrans($xhtitle,"",255)
EndIf
ExitLoop
WEnd
EndFunc
Func _starting()
While 1
$CK = WinList()
For $i = 1 To $CK[0][0]
$j = ControlGetFocus($CK[$i][0],"")
$H = ControlGetText($CK[$i][0],"",$j)
GUICtrlSetData($xianshixh,$H)
Next
WEnd
EndFunc |
|