This program displays all Windows error messages:
Code: (Select All)
Rem search for error messages in windows
Declare Dynamic Library "kernel32"
Function FormatMessageA& (ByVal f As Long, f$, Byval e As Long, Byval d As Long, g$, Byval s As Long, h$)
Function GetLastError& ()
End Declare
' count error messages
Dim m As String * 260
For x& = 1 To 15299
y& = FormatMessageA&(&H1200, "", x&, 0, m$, 260, "")
If y& Then
c = c + 1
x$ = "Error 0x" + Hex$(x&) + " (" + LTrim$(Str$(x&)) + ")"
y$ = Left$(m$, y& - 2)
length = length + Len(x$) \ 80 + Len(y$) \ 80 + 2
If length >= 22 Then
length = 0
If p = 0 Then
Color 15
Print "-more(y/n/c)-";
Do
_Limit 50
z$ = LCase$(InKey$)
If z$ = "c" Then p = -1: Print: Exit Do
If z$ = "y" Then Print: Exit Do
If z$ = "n" Then Print: Exit For
Loop
End If
End If
Color 14
Print x$
Print y$
End If
Next
Color 14
Print "There were"; c; "messages found."
Color 7
End