by Will Brendel (5 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating:
(4 Votes)
This code just causes those neat little errors Windows sends us every so often. I don't think there's a use for this, but here it is anyway. Just a note, it also closes the VB IDE when called so watch out!
Inputs
Buttons: cmdFatalAppExit, cmdFatalExit
Side Effects
Crashes VB IDE if called from within the IDE.
API DeclarationsPrivate Declare Sub FatalAppExit Lib "kernel32" Alias "FatalAppExitA" (ByVal uAction As Long, ByVal lpMessageText As String)
Private Declare Sub FatalExit Lib "kernel32" (ByVal code As Long)
Private Sub cmdFatalAppExit_Click()
FatalAppExit 0, "You can replace this message with one of your own." & vbLf & vbLf & "Multiple lines are allowed too!"
End Sub
Private Sub cmdFatalExit_Click()
FatalExit 1
End Sub