LookupErrors utility

Version 1.0.0.1     2024-11-22

Charles Dye

Purpose:

This utility displays the text for a Windows error code. It’s a functional replacement for the LookupErrors.exe included with Take Command v22 and later. You can use it in TCC/LE and in earlier versions of Take Command either by putting it in your search path somewhere, or by creating an alias to launch it. You can even use it from cmd.exe.

Features:

Syntax:

LOOKUPERRORS /A:alpha /C /I /N:flags /P:pos /T n

/A:alphaset the ‘faded’ transparency level
/Cclose any open LookupErrors dialogs
/Ienable fading when the dialog is not active
/N:flagsdisable features:
    I    fading
    T    topmost
/P:posposition on parent window (0–9)
/Tkeep the dialog on top of other windows
  
nthe Windows error code to look up

n may be decimal, or hexadecimal with a leading 0x.

/A:alpha sets the transparency level of the LookupErrors dialog when it’s not active and the ‘Fade when Inactive’ option is set. The range allowed for alpha is 48 (very faint) to 240 (nearly opaque); the default is 224.

/I, /N:I, /T, and /N:T enable and disable the ‘fade when inactive’ and ‘topmost’ options. The colon after /N is optional. Note that I and T are the accelerator keys for these options in the dialog box.

/P:pos: The ‘Position on parent’ value controls how the LookupErrors dialog is positioned on the parent window when no valid position values are found in the registry. The default is 9, at the upper right of TCC’s window.

7: top left8: top center9: top right
4: center left5: centered6: center right
1: bottom left2: bottom center3: bottom right

Dialog Position:

The 📌︎ tick box at the upper right corner controls whether the dialog’s screen position is saved. If it is checked when you close the LookupErrors dialog, the dialog’s screen position will be saved to the registry, and the dialog will reopen at the same position the next time you run the program.

If the 📌︎ tick box is not checked when you close the dialog, any screen position will be deleted from the registry. The next time you run LookupErrors.exe, the dialog will be positioned on TCC’s window.

Registry Use:

LookupErrors setting are stored in the registry under HKEY_CURRENT_USER\Software\JPPlugins\LookupErrors.

Value Name:Type:Description:
AlphaREG_DWORDtransparency of ‘faded’ dialog, 0x30 to 0xE0
Always on topREG_DWORDboolean: nonzero if ‘topmost’ is enabled
Fade when inactiveREG_DWORDboolean: nonzero if ‘fade when inactive’ is enabled
Position on parentREG_DWORDcontrols the dialog’s position on TCC’s window; see /P:pos
XREG_DWORDdialog X coordinate; saved only if 📌︎ is checked at close
YREG_DWORDdialog Y coordinate; saved only if 📌︎ is checked at close

Acknowledgments:

The “open book” icon is by Freepik, https://www.freepik.com/. I downloaded it from FlatIcon: https://www.flaticon.com/free-icon/open-book_9809619/

Changes:


VersionDateChanges
1.0.0.12024-11-22Fix for ‘Fade when Inactive’ not working. (No changes to the code — just sets WS_EX_LAYERED, which I had removed to work around a bug in Visual Studio 2022 and forgot to restore.)
1.0.02024-08-05First release version.
0.99.412024-07-30Adds undocumented registry options.
0.99.40.22024-07-29Changed PROGRAM_WEB_PAGE to begin with https:// instead of http://
0.99.40.12024-07-26Added support for octal (prefix 0o) and binary (prefix 0b).
0.99.402024-07-09This version adds support for Windows 10 virtual desktops:
Upgraded to Visual Studio 2022 (oh, the horror!)
Added checks to not reuse an open LookupErrors dialog from a different virtual desktop.
/C only closes open dialogs on the current virtual desktop; /CC closes open dialogs on all desktops.
Now /C and /CC also close the help text message boxes.
Removed the unused LargeFont and UnderlinedFont variables.
No longer compress the executable with UPX.
Made the dialog a wee bit narrower and a smidgen taller.
Removed the FORMAT_MESSAGE_MAX_WIDTH_MASK flag.
0.99.32.22024-06-21Renamed WM_UPDATE_ERROR to WM_UPDATE_ERROR_VALUE.
0.99.32.12024-06-11Added the program’s icon to the About dialog.
0.99.322024-05-23Removed support for /W:hwnd. Now /W: is just silently ignored.
0.99.312024-05-23Parent windows from /W: of class “VirtualConsoleClass” may also be rejected or changed (workaround for TCC’s internal LOOKUPERRORS command running in ConEmu.)
Removed the undocumented /W:hwnd,pos syntax.
0.99.302024-05-22If a parent window was specified via /W:, attempt to guess its type, in order to better position the popup on the parent window.
0.99.292024-05-15Permit negative error numbers on the command line and in the edit control.
0.99.28.12024-05-14Allow options to begin with a hyphen instead of a forward slash. Replaced the “Big Red X” icon with the “open book” icon.
0.99.282024-05-02If the parent window specified via /W is invisible, entirely offscreen, or of class “PseudoConsoleWindow”, ignore it.

Status and Licensing:

This program is © Copyright 2024, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. If you find a problem, you can report it in the JP Software support forum.

Download:

You can download the current version of the program from https://charlesdye.net/dl/lookuperrors.zip.