CodeItBetter Programming Another VB Programming Blog

How to Crash your application (in two ways)

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'System & API - How to Crash your application (in two ways)

'Method 1:

Option Explicit
 
Declare Sub FatalExit Lib "kernel32" (ByVal Code As Long)
 
Private Sub Main()
    FatalExit 1
End Sub
 
'Method 2:

Option Explicit
 
Declare Sub FatalAppExit Lib "kernel32" Alias "FatalAppExitA" (ByVal uAction As Long, _
    ByVal lpMessageText As String)
 
Private Sub Form_Load()
    FatalAppExit 0, "Application Crashed..."
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.