源代碼:
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)擊 開始-關(guān)閉計算機(jī)-關(guān)閉,電腦也不會被關(guān)機(jī)。
|
|