KittenOfDeath

Dumped executables from SBCL on Win32 open a useless terminal window with the message "Your kitten of death awaits." User nyef from #lisp sent me this, but I haven't tried it yet:

(with-open-file (exe #p"path/to/game.exe" :direction :io :element-type '(unsigned-byte 8))  (file-position exe #x3c)   (let* ((b0 (read-byte exe))          (b1 (read-byte exe))           (b2 (read-byte exe))           (b3 (read-byte exe))          (pe-header (dpb (dpb b3 (byte 8 8) b2)                          (byte 16 16)                          (dpb b1 (byte 8 8) b0)))) (file-position exe (+ pe-header #x5c)) (write-byte 3 exe)))

Another possibility is to use GetConsoleWindow to obtain an HWND and pass that to ShowWindow. Something like the following (not tested, compiled, desk-checked, or even strictly correct):

(defconstant SW_HIDE 0) (define-alien-routine ("ShowWindow" |ShowWindow|) int (int int)) (define-alien-routine ("GetConsoleWindow" |GetConsoleWindow|) int) (defun hide-console-window   (|ShowWindow| (|GetConsoleWindow|) SW_HIDE))

HIDE-CONSOLE-WINDOW would be called from an application startup function to hide the (already visible) console window. This would cause some flicker, but doesn't require patching the executable. Shortcuts taken include not having specified which libraries to load for ShowWindow and GetConsoleWindow (USER32 for the former, probably USER32 or KERNEL32 for the latter), using ints instead of HWNDs (the return value from GetConsoleWindow and the first parameter to ShowWindow), and generally not testing.