System Message

System Message is a utilitiy for looking up the descriptive text that corresponds to a Windows system error number. System Message can be used either as a desktop application or as a simple out-of-process OLE Automation server.

Download Version 1.1.1.0

I originally wrote System Message because I constantly needed to look up the message text corresopnding to an error value at a time when no such tool was widely available. However, the utility of System Message is fairly questionable today since Microsoft Visual Studio has been shipping with a similar tool called Error Lookup since quite some time. Moreover, the @err pseudo-register and the hr format specification in watch expressions of the IDE debugger provides the same functionality. System Message is nonetheless useful for system administrators who wish to decode error numbers and Windows developers that use another IDE than Microsoft Visual Studio.

System Message tool screenshot

Using System Message

When you run the tool as a normal application, System Message displays a modeless dialog box as show in screenshot. As soon as you start typing an ID in the text box, System Message attempts to fetch the corresponding message from the system.

You can either entier the ID as a signed 32-bit or as an unsigned hex-decimal value. If the ID starts with the characters 0x, System Message treats the input as an unsigned 32-bit hex-decimal. Otherwise, by default, the input is always assumed to be a singed 32-bit value.

If you press ENTER or ESC, System Message minimizes the dialog and remains on the TaskBar for further use. If you want quit the application, then click the close button on the window, or select Close from the system menu of the dialog box.

System Message Automation Server

System Message can also be used as an out-of-process OLE Automation server. To register it, start the application with the /REGSERVER or -REGSERVER switch. Thereafter, you can create an instance of System Message from using the ProgID of SysMsg.Application. The following example illustrates how to use System Message from VBScript and Windows Scripting Host (WSH):

Dim SysMsg
Set SysMsg = WScript.CreateObject("SysMsg.Application")
WScript.Echo SysMsg.GetSystemMessage(5)

System Message also provides a method to retrieve the different parts of a system message ID, that is, the severity, customer, facility and status code of the ID. Here's you would call it:

Dim Severity, Customer, Facility, Status
SysMsg.GetIdCodes -2147352559, Severity, Customer, Facility, Status

SysMsg.Application Object

CLSID
{D11CC853-F7B1-11d0-9871-00805F4A544E}
IDL Definition
[ uuid(D11CC851-F7B1-11d0-9871-00805F4A544E), odl, oleautomation ]
interface IApplication : IUnknown
{
HRESULT GetSystemMessage([in] long ID, [out, retval] BSTR* Message);
HRESULT GetIdCodes([in] long ID,
    [in, out, optional] VARIANT* SeverityCode,
    [in, out, optional] VARIANT* CustomerCode,
    [in, out, optional] VARIANT* FacilityCode,
    [in, out, optional] VARIANT* StatusCode);
}