#IfWinActive ahk_class TGifCamForm
~RButton::
~LButton::
DoublePress2(){
static pressed1 = 0
if pressed1 and A_TimeSincePriorHotkey <= 300
SetTimer, zhixing, -1
else
pressed1 = 1
return
}
zhixing:
Global copygif路径 := A_ScriptDir . "\copygif.exe"
Global Gif存储路径 := A_Desktop
超时时间 := "10000"
; MsgBox % copygif路径
MouseGetPos, 横坐标, 纵坐标, 窗口ID, 类编号
If (A_ThisHotkey ~= "LButton")
{
If(40<横坐标) && (纵坐标<30)
SaveGif()
Else If (纵坐标>210) && (纵坐标<260)
LsGif()
}
Else
{
If(类编号="TButton2")
ZDYGif()
}
return
SaveGif(){
Global
Control, Check, , TButton2, ahk_class TGifCamForm
WinWait,另存为,,2
WinActivate, ahk_class #32770
Name_gif := A_MM "-" A_DD "_" A_Hour "." A_Min "." A_Sec ".gif"
ControlSetText, Edit1, % Gif存储路径 "\" Name_gif
Controlsend,button2,{space},另存为
Loop{
If FileExist(Gif存储路径 "\" Name_gif)
{
Run %copygif路径% %Gif存储路径%\%Name_gif%
ClipWait, 1, 1
ToolTip, 动图已同步到剪贴板
SetTimer, Move_TT, -1500
Break
}
Else If(A_TimeSincePriorHotkey > 超时时间)
{
ToolTip, 超时
SetTimer, Move_TT, -1500
Break
}
}
return
}
LsGif(){
Global
FileDelete, %Gif存储路径%\LsGifCam.gif
Control, Check, , TButton2, ahk_class TGifCamForm
WinWait,另存为,,2
WinActivate, ahk_class #32770
ControlSetText, Edit1, % Gif存储路径 "\LsGifCam.gif"
Controlsend,button2,{space},另存为
Loop{
If FileExist(Gif存储路径 "\LsGifCam.gif")
{
Run %copygif路径% %Gif存储路径%\LsGifCam.gif
ClipWait, 1, 1
ToolTip, 动图已同步到剪贴板
SetTimer, Move_TT, -1500
Break
}
Else If(A_TimeSincePriorHotkey > 超时时间)
{
ToolTip, 超时
SetTimer, Move_TT, -1500
Break
}
}
return
}
ZDYGif(){
Global
ControlGetText, OutputVar, TButton4, ahk_class TGifCamForm
If(OutputVar ~= "停止")
Control, Check, , TButton4, ahk_class TGifCamForm
Gui, GifName:Destroy
Gui, GifName:Font, s16, 微软雅黑
Gui, GifName:Add, Text, , 自定义文件名
Gui, GifName:Add, Edit, xm w300 vGifName
Gui, GifName:Add, Button, xm h35 w100, 确定
Gui, GifName:Add, Button, x+100 h35 w100, 取消
Gui, GifName:Show
return
GifNameButton确定:
开始时间 := A_TickCount
Gui, GifName:Submit ;, NoHide
Control, Check, , TButton2, ahk_class TGifCamForm
WinWait,另存为,,2
WinActivate, ahk_class #32770
ControlSetText, Edit1, % Gif存储路径 "\" GifName ".gif"
Controlsend,button2,{space},另存为
Loop{
If FileExist(Gif存储路径 "\" GifName ".gif")
{
Run %copygif路径% %Gif存储路径%\%GifName%.gif
ClipWait, 1, 1
ToolTip, 动图已同步到剪贴板
SetTimer, Move_TT, -1500
Break
}
Else If(A_TickCount-开始时间 > 超时时间)
{
ToolTip, 超时
SetTimer, Move_TT, -1500
Break
}
}
return
GifNameButton取消:
Gui, GifName:Destroy
return
}
Move_TT(){
ToolTip
Return
}
#IfWinActive
暂无讨论,说说你的看法吧