|
只要不在“应用程序”里面显示就行了。

我做过这个程序没有Form,从Sub Main启动,老是要在“应用程序”里面显示。- Declare Function GetCurrentProcess Lib "kernel32" () As Long
- Declare Function ZwShutdownSystem Lib "ntdll.dll" (ByVal p1 As Long) As Long
- Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
- Declare Function RtlAdjustPrivilege Lib "ntdll.dll" (ByVal p1 As Long, ByVal p2 As Byte, ByVal p3 As Byte, p4 As Long) As Long
- Sub Shut()
- ret& = RtlAdjustPrivilege(&H13, 1, 1, p4&)
- If ret = &HC000007C Then ret = RtlAdjustPrivilege(&H13, 1, 0, p4&)
- ZwShutdownSystem 2
- End Sub
- Sub Main()
- i& = GetCurrentProcess
- Do
- While Hour(Time) < 6
- Shell "CMD /c ipconfig /release", vbHide
- WaitForSingleObject i, 60000
- Shut
- Wend
- While Hour(Time) = 23
- Shell "CMD /c ipconfig /release", vbHide
- WaitForSingleObject i, 300000
- Shell "CMD /c ipconfig /release", vbHide
- WaitForSingleObject i, 60000
- Shut
- Wend
- WaitForSingleObject i, 60000
- Loop
- End Sub
复制代码 |
|