Hi,
I need to intercept the windows Shutdown event and Cancel it depending on the user input.

I have tried using the AbortSystemShutdown API but its not working. I have tried setting the lpMachineName variable to my machine name (AbortSystemShutdown "abc").

I am using Windows 2000.

Thanks in advance.

I am trying the following code :


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbAppWindows Then
ans = MsgBox("Are you sure you want to shutdonw the computer ?", vbYesNoCancel)
If ans = vbYes Then
AbortSystemShutdown ""
End If
End If
End Sub