diff --git a/System/Console/ANSI/Windows/Emulator.hs b/System/Console/ANSI/Windows/Emulator.hs
--- a/System/Console/ANSI/Windows/Emulator.hs
+++ b/System/Console/ANSI/Windows/Emulator.hs
@@ -12,6 +12,7 @@
 import Control.Monad (guard)
 
 import Data.Bits
+import Data.Char (toLower)
 import Data.List
 
 
@@ -42,7 +43,8 @@
     -- NB: this is a pretty hacked-up way to find out if we have the right sort of exception, but System.Win32.Types.fail* call into
     -- the fail :: String -> IO a function, and so we don't get any nice exception object we can extract information from.
     isHandleIsInvalidException :: SomeException -> Bool
-    isHandleIsInvalidException e ="The handle is invalid" `isInfixOf` show e
+    isHandleIsInvalidException e = "the handle is invalid" `isInfixOf` e_string || "invalid handle" `isInfixOf` e_string
+      where e_string = map toLower (show e)
 
 
 adjustCursorPosition :: HANDLE -> (SHORT -> SHORT -> SHORT) -> (SHORT -> SHORT -> SHORT) -> IO ()
diff --git a/ansi-terminal.cabal b/ansi-terminal.cabal
--- a/ansi-terminal.cabal
+++ b/ansi-terminal.cabal
@@ -1,5 +1,5 @@
 Name:                ansi-terminal
-Version:             0.5.3
+Version:             0.5.4
 Cabal-Version:       >= 1.2
 Category:            User Interfaces
 Synopsis:            Simple ANSI terminal support, with Windows compatibility
