本帖最后由 love5173 于 2012-1-17 15:40 编辑
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ScreenCapture.au3>
#Region ### START Koda GUI section ### Form=
Opt("GUIOnEventMode",1)
HotKeySet("{PRINTSCREEN}","jietu")
GUISetOnEvent($GUI_EVENT_CLOSE,"gui")
Global $str2,$Form1
$ip1=StringSplit(@IPAddress1,".")
$ip="-"&$ip1[3]&"."&$ip1[4]
TCPStartUp()
While 1
$nMsg = GUIGetMsg()
$MainSocket=TCPListen(@IPAddress1,7788)
$ConnectedSocket = -1
Do
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1
$str=BinaryToString(TCPRecv($ConnectedSocket,10000,1))
go($str)
TCPCloseSocket($MainSocket)
$nMsg = GUIGetMsg()
If $nMsg=$GUI_EVENT_CLOSE Then GUIDelete(@GUI_WinHandle)
WEnd
Func gui()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
GUIDelete(@GUI_WinHandle)
EndSwitch
EndFunc
Func guihand()
$sum=WinList("发货辅助窗口","")
Return $sum[0][0]
EndFunc
Func go($str2)
GUICreate("发货辅助窗口-"&guihand()+1, 439, 297, Random(0,800,1), Random(0,400,1))
GUISetOnEvent($GUI_EVENT_CLOSE,"gui")
GUICtrlCreateButton("截图", 8, 248, 113, 41)
GUICtrlCreateLabel("截图的快捷键是F1", 128, 248, 209, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateEdit("", 0, 0, 433, 241)
GUICtrlSetData(-1,$str2)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
EndFunc
Func jietu()
DirCreate("\\192.168.0.86\quandaye\发货截图\"&@YEAR&"年"&@MON&"月"&@MDAY&"日")
_ScreenCapture_SetJPGQuality(40)
_ScreenCapture_Capture("\\192.168.0.86\quandaye\发货截图\"&@YEAR&"年"&@MON&"月"&@MDAY&"日\"&@HOUR&@MIN&@SEC&$ip&".jpg")
EndFunc
|