|
如何去除这段代码中的需要在windows快捷托盘图标,让这个程序运行在进程内
不运行在桌面上,只运行在进行当中,希望高手可以指点
此段代码是关机代码
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=桌面\Software_Icons_004.ico
#AutoIt3Wrapper_Res_Description=日利
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GuiConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $rq, $btn, $msg,$hListView, $h, $m, $s, $T, $n, $y, $r,$sht,$nowt,$SHT,$NOWT,$rqc,$timec,$StartTicks,$EndTicks
Local $tTime, $aTime
Global $Sec, $Min, $Hour, $Time
GUICreate(" 定时关机", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
; Get current system time
$StartTicks = _TimeToTicks(@HOUR,@MIN,@SEC)
$EndTicks = $StartTicks
_TicksToTime($EndTicks,$Hour,$Min,$Sec)
$tTime = _Date_Time_GetSystemTime()
$aTime = _Date_Time_SystemTimeToArray($tTime)
$n = GUICtrlCreateInput($aTime[2], 45,10, 30, 20)
GUICtrlCreateLabel("日期:", 10, 13,30,20)
GUICtrlCreateLabel("(输入日期)", 150, 13,150,20)
$y = GUICtrlCreateInput($aTime[0], 75,10, 30, 20)
$rq = GUICtrlCreateInput("", 105,10, 30, 20)
$h = GUICtrlCreateInput("", 45,40, 30, 20)
GUICtrlCreateLabel("时间:", 10, 43,30,20)
GUICtrlCreateLabel("(输入时间)", 150, 43,150,20)
$m = GUICtrlCreateInput("", 75,40, 30, 20)
$s = GUICtrlCreateInput("", 105,40, 30, 20)
$btn = GUICtrlCreateButton("确认", 40, 75, 60, 20)
GUISetState()
Do
$msg = GUIGetMsg()
if $msg = $btn then
$RQ = GUICtrlRead($rq)
$H = GUICtrlRead($h)
$M = GUICtrlRead($m)
$S = GUICtrlRead($s)
If $RQ > 31 or $H > 24 or $M > 60 or $S > 60 Then
MsgBox(4096,"", "输入有误,请重新输入时间.")
EndIf
MsgBox(262144,'' , '你输入的关机时间:' & $RQ & '号' & $H & ":" & $M & ":" & $S)
$rqc = $RQ - $aTime[1]
$sht = $H * 3600000 +$M * 60000 + $S * 1000
$nowt = $Hour * 3600000 + $Min * 60000 + $Sec * 1000
$timec = 24 * $rqc * 3600000 + $sht - $nowt
MsgBox(4096, "开始启动",$timec, 10)
WinSetState(" 定时关机", "", @SW_HIDE)
Sleep($timec)
Shutdown(5)
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example |
|