源代碼:
Private Declare Function SetProcessShutdownParameters Lib "kernel32" (ByVal dwLevel As Long, ByVal dwFlags As Long) As Long
Private Sub Form_Load() Call SetProcessShutdownParameters(1279, 0&) End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If UnloadMode = vbAppWindows Then Cancel = 1 End If End Sub 只要程序不被關(guān)閉,點(diǎn)擊 開(kāi)始-關(guān)閉計(jì)算機(jī)-關(guān)閉,電腦也不會(huì)被關(guān)機(jī)。
|
|
來(lái)自: 笨笨兄圖書(shū)館 > 《VB》