System.Win32.Console.CtrlHandler

Win32-2.5.4.1: A binding to part of the Win32 library

Copyright | 2008-2013 Judah Jacobson 2013 shelarcy
License | BSD-style
Maintainer | shelarcy@gmail.com
Stability | Provisional
Portability | Non-portable (Win32 API)
Safe Haskell | Safe
Language | Haskell98

System.Win32.Console.CtrlHandler

Description

Set handlers of console Ctrl events.

Synopsis

- type CtrlEvent = DWORD
- type Handler = CtrlEvent -> IO BOOL
- type PHANDLER_ROUTINE = FunPtr Handler
- withConsoleCtrlHandler :: Handler -> IO a -> IO a
- setConsoleCtrlHandler :: PHANDLER_ROUTINE -> BOOL -> IO ()
- c_SetConsoleCtrlHandler :: PHANDLER_ROUTINE -> BOOL -> IO BOOL
- mkHandler :: Handler -> IO PHANDLER_ROUTINE
- cTRL_C_EVENT :: CtrlEvent
- cTRL_BREAK_EVENT :: CtrlEvent

# Documentation

type CtrlEvent = DWORD Source #

type Handler = CtrlEvent -> IO BOOL Source #

type PHANDLER_ROUTINE = FunPtr Handler Source #

withConsoleCtrlHandler :: Handler -> IO a -> IO a Source #

setConsoleCtrlHandler :: PHANDLER_ROUTINE -> BOOL -> IO () Source #

This function isn't suitable when we want to set the cTRL_C_EVENT handler. If you want to set the cTRL_C_EVENT handler, use `c_SetConsoleCtrlHandler` instead.

c_SetConsoleCtrlHandler :: PHANDLER_ROUTINE -> BOOL -> IO BOOL Source #

mkHandler :: Handler -> IO PHANDLER_ROUTINE Source #

cTRL_C_EVENT :: CtrlEvent Source #

cTRL_BREAK_EVENT :: CtrlEvent Source #