112、昨晚看着手机睡着了~>_<~
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=lonyii.ico
#AutoIt3Wrapper_Outfile=dfxx.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Description=D&F XXYY
#AutoIt3Wrapper_Res_Fileversion=1.0.0.102
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=Lonyii 2009
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 3)
$iKey = IniRead(@ScriptDir & "/KeySet.ini", "Setup", "SentKey", "{numpad2}") ;默认是按下向右连续发送Num2,可以通过KeySet.ini来修改
$KeyCode = IniRead(@ScriptDir & "/KeySet.ini", "Setup", "KeyCode", "65")
$T_goUrl = TrayCreateItem("Http://www.lonyii.cn/")
$T_about = TrayCreateItem("About")
TrayCreateItem("")
$T_Pause = TrayCreateItem("&Pause")
TrayCreateItem("")
$T_exit = TrayCreateItem("Exit")
TraySetState()
While 1
iStart()
Sleep(10)
$T_msg = TrayGetMsg()
TrayMsg($T_msg)
WEnd
Func iStart()
If iPressed($KeyCode) Then
While 1
Send($iKey)
If iUped($KeyCode) Then ExitLoop
Sleep(10)
WEnd
EndIf
EndFunc ;==>iStart
Func iPressed($iHexKey, $cDLL = 'user32.dll');判断按键是否按下
Local $ia_R = DllCall($cDLL, "int", "GetAsyncKeyState", "int", '0x' & $iHexKey)
If Not @error And BitAND($ia_R[0], 0x8000) = 0x8000 Then Return 1
Return 0
EndFunc ;==>iPressed
Func iUped($iHexKey, $cDLL = 'user32.dll');判断按键是否松开
Local $ia_R = DllCall($cDLL, "int", "GetAsyncKeyState", "int", '0x' & $iHexKey)
If Not @error And BitAND($ia_R[0], 0x8000) = 0x0000 Then Return 1
Return 0
EndFunc ;==>iUped
Func TogglePause()
$Paused = Not $Paused
If $Paused Then
TrayItemSetText($T_Pause, "&Resume")
TraySetIcon("Shell32.dll",-28)
Else
TrayItemSetText($T_Pause, "&Pause")
TraySetIcon()
EndIf
While $Paused
Sleep(10)
ToolTip('Script is "Paused"', @DesktopWidth - 140, @DesktopHeight - 60);,"", 1, 1)
$T_msg = TrayGetMsg()
TrayMsg($T_msg)
WEnd
ToolTip("")
EndFunc ;==>TogglePause
Func TrayMsg($T_msg)
Switch $T_msg
Case $T_exit
Exit
Case $T_about
MsgBox(64, "About - My Site", "http://www.lonyii.cn")
Case $MT_goUrl
Run(@ProgramFilesDir & "\Internet Explorer\IEXPLORE.EXE http://www.lonyii.cn")
Case $T_Pause
TogglePause()
EndSwitch
EndFunc
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=lonyii.ico
#AutoIt3Wrapper_Outfile=dfxx.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Description=D&F XXYY
#AutoIt3Wrapper_Res_Fileversion=1.0.0.102
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=Lonyii 2009
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 3)
$iKey = IniRead(@ScriptDir & "/KeySet.ini", "Setup", "SentKey", "{numpad2}") ;默认是按下向右连续发送Num2,可以通过KeySet.ini来修改
$KeyCode = IniRead(@ScriptDir & "/KeySet.ini", "Setup", "KeyCode", "65")
$T_goUrl = TrayCreateItem("Http://www.lonyii.cn/")
$T_about = TrayCreateItem("About")
TrayCreateItem("")
$T_Pause = TrayCreateItem("&Pause")
TrayCreateItem("")
$T_exit = TrayCreateItem("Exit")
TraySetState()
While 1
iStart()
Sleep(10)
$T_msg = TrayGetMsg()
TrayMsg($T_msg)
WEnd
Func iStart()
If iPressed($KeyCode) Then
While 1
Send($iKey)
If iUped($KeyCode) Then ExitLoop
Sleep(10)
WEnd
EndIf
EndFunc ;==>iStart
Func iPressed($iHexKey, $cDLL = 'user32.dll');判断按键是否按下
Local $ia_R = DllCall($cDLL, "int", "GetAsyncKeyState", "int", '0x' & $iHexKey)
If Not @error And BitAND($ia_R[0], 0x8000) = 0x8000 Then Return 1
Return 0
EndFunc ;==>iPressed
Func iUped($iHexKey, $cDLL = 'user32.dll');判断按键是否松开
Local $ia_R = DllCall($cDLL, "int", "GetAsyncKeyState", "int", '0x' & $iHexKey)
If Not @error And BitAND($ia_R[0], 0x8000) = 0x0000 Then Return 1
Return 0
EndFunc ;==>iUped
Func TogglePause()
$Paused = Not $Paused
If $Paused Then
TrayItemSetText($T_Pause, "&Resume")
TraySetIcon("Shell32.dll",-28)
Else
TrayItemSetText($T_Pause, "&Pause")
TraySetIcon()
EndIf
While $Paused
Sleep(10)
ToolTip('Script is "Paused"', @DesktopWidth - 140, @DesktopHeight - 60);,"", 1, 1)
$T_msg = TrayGetMsg()
TrayMsg($T_msg)
WEnd
ToolTip("")
EndFunc ;==>TogglePause
Func TrayMsg($T_msg)
Switch $T_msg
Case $T_exit
Exit
Case $T_about
MsgBox(64, "About - My Site", "http://www.lonyii.cn")
Case $MT_goUrl
Run(@ProgramFilesDir & "\Internet Explorer\IEXPLORE.EXE http://www.lonyii.cn")
Case $T_Pause
TogglePause()
EndSwitch
EndFunc










