|
本帖最后由 6vvvvvv 于 2015-10-30 18:57 编辑
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;画出交互界面并隐藏,等待热键
$Form1_1 = GUICreate("微信二维码拍照程序", 531, 141, 695, 666)
$Input1 = GUICtrlCreateInput("", 64, 56, 425, 21)
$czbutton = GUICtrlCreateButton("充值", 64, 104, 89, 25)
$czbutton2 = GUICtrlCreateButton("拍照", 264, 104, 89, 25)
$Label1 = GUICtrlCreateLabel("请输入微信二维码", 72, 16, 100, 17)
GUISetState(@SW_HIDE)
HotKeySet("^!x", "_Echowin1")
While 1
Sleep(500)
WEnd
;交互界面
FUNC _Echowin1()
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $czbutton; 按下[充值]
_Captureimg1()
Case $nMsg = $czbutton2; 按下[拍照]
_Captureimg2()
Case $nmsg = $GUI_EVENT_CLOSE; 关闭程序,隐藏[窗口]
GUISetState(@SW_HIDE)
ExitLoop
EndSelect
WEnd
EndFunc
;[充值]截屏程序1
Func _Captureimg1()
Dim $captureimgname
$captureimgname = "D:\充值\"& GUICtrlRead($Input1)&"_" & @YEAR & "_" & @MON & @MDAY & "_" & @HOUR & @MIN & "_" & @SEC & ".jpg"
Send("{PRINTSCREEN}")
Sleep(1000)
Run("mspaint.exe")
_winwaitactivate("[class:MSPaintApp]", "")
Send("{CTRLDOWN}v{CTRLUP}{ALTDOWN}{ALTUP}fa")
Sleep(1000)
Send($captureimgname)
Send("{ENTER}")
_winwaitactivate("[class:MSPaintApp]", "")
Send("{ALTDOWN}{ALTUP}fx")
EndFunc
Func _winwaitactivate($title, $text, $timeout = 0)
WinWait($title, $text, $timeout)
If NOT WinActive($title, $text) Then WinActivate($title, $text)
WinWaitActive($title, $text, $timeout)
EndFunc
;[拍照]截屏程序2
Func _Captureimg2()
Dim $captureimgname
$captureimgname = "D:\拍照\" & @YEAR & "_" & @MON & @MDAY & "_" & @HOUR & @MIN & "_" & @SEC & ".jpg"
Send("{PRINTSCREEN}")
Sleep(1000)
Run("mspaint.exe")
_winwaitactivate2("[class:MSPaintApp]", "")
Send("{CTRLDOWN}v{CTRLUP}{ALTDOWN}{ALTUP}fa")
Sleep(1000)
Send($captureimgname)
Send("{ENTER}")
_winwaitactivate2("[class:MSPaintApp]", "")
Send("{ALTDOWN}{ALTUP}fx")
EndFunc
Func _winwaitactivate2($title, $text, $timeout = 0)
WinWait($title, $text, $timeout)
If NOT WinActive($title, $text) Then WinActivate($title, $text)
WinWaitActive($title, $text, $timeout)
EndFunc |
|