module System.Win32.Console (
getConsoleCP,
setConsoleCP,
getConsoleOutputCP,
setConsoleOutputCP,
CtrlEvent, cTRL_C_EVENT, cTRL_BREAK_EVENT,
generateConsoleCtrlEvent
) where
#include "windows_cconv.h"
import System.Win32.Types
foreign import WINDOWS_CCONV unsafe "windows.h GetConsoleCP"
getConsoleCP :: IO UINT
foreign import WINDOWS_CCONV unsafe "windows.h SetConsoleCP"
setConsoleCP :: UINT -> IO ()
foreign import WINDOWS_CCONV unsafe "windows.h GetConsoleOutputCP"
getConsoleOutputCP :: IO UINT
foreign import WINDOWS_CCONV unsafe "windows.h SetConsoleOutputCP"
setConsoleOutputCP :: UINT -> IO ()
type CtrlEvent = DWORD
cTRL_C_EVENT :: CtrlEvent
cTRL_C_EVENT = 0
cTRL_BREAK_EVENT :: CtrlEvent
cTRL_BREAK_EVENT = 1
generateConsoleCtrlEvent :: CtrlEvent -> DWORD -> IO ()
generateConsoleCtrlEvent e p
= failIfFalse_
"generateConsoleCtrlEvent"
$ c_GenerateConsoleCtrlEvent e p
foreign import WINDOWS_CCONV safe "windows.h GenerateConsoleCtrlEvent"
c_GenerateConsoleCtrlEvent :: CtrlEvent -> DWORD -> IO BOOL