#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form = GUICreate("记录笔", 259, 69, 192, 124)
$Button = GUICtrlCreateButton("记录", 80, 16, 81, 33)
GUISetState(@SW_SHOW)
Dim $i , $txt, $Paused,$record,$Edit
HotKeySet("{F1}", "Pause")
HotKeySet("{ESC}", "ESC")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
GUICtrlSetData($Button,'停止')
_ClipGet()
EndSwitch
WEnd
Func _ClipGet()
$txt = ''
$Clip= ''
For $i = 1 To 10000
Sleep(2000)
Send("^c")
If ClipGet()<>$Clip Then
$Clip =ClipGet()
$txt = $txt& @CRLF&ClipGet()
ToolTip($txt,0,0)
Else
ContinueLoop
EndIf
Next
EndFunc
Func Pause()
$Paused = NOT $Paused
While $Paused
sleep(100)
TrayTip("暂停记录","",0)
WEnd
EndFunc
Func ESC()
ClipPut($txt)
MsgBox(0, "剪贴板内容:",$txt )
Exit
EndFunc
粗略写了一个,自己改良下就成为一个不错的小工具了 |