System.Win32.Console

Win32-2.6.2.1: A binding to Windows Win32 API.

Copyright | (c) University of Glasgow 2006
License | BSD-style (see the file LICENSE)
Maintainer | Esa Ilari Vuokko <ei@vuokko.info>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

System.Win32.Console

Contents

- Console code pages
- Ctrl events
- Command line
- Screen buffer

Description

A collection of FFI declarations for interfacing with Win32 Console API

Synopsis

- getConsoleCP :: IO UINT
- setConsoleCP :: UINT -> IO ()
- getConsoleOutputCP :: IO UINT
- setConsoleOutputCP :: UINT -> IO ()
- type CtrlEvent = DWORD
- cTRL_C_EVENT :: CtrlEvent
- cTRL_BREAK_EVENT :: CtrlEvent
- generateConsoleCtrlEvent :: CtrlEvent -> DWORD -> IO ()
- commandLineToArgv :: String -> IO [String]
- data CONSOLE_SCREEN_BUFFER_INFO = CONSOLE_SCREEN_BUFFER_INFO {
  - dwSize :: COORD
  - dwCursorPosition :: COORD
  - wAttributes :: WORD
  - srWindow :: SMALL_RECT
  - dwMaximumWindowSize :: COORD
  }
- data COORD = COORD {
  - x :: SHORT
  - y :: SHORT
  }
- data SMALL_RECT = SMALL_RECT {
  - left :: SHORT
  - top :: SHORT
  - right :: SHORT
  - bottom :: SHORT
  }
- getConsoleScreenBufferInfo :: HANDLE -> IO CONSOLE_SCREEN_BUFFER_INFO
- getCurrentConsoleScreenBufferInfo :: IO CONSOLE_SCREEN_BUFFER_INFO

# Console code pages

getConsoleCP :: IO UINT #

setConsoleCP :: UINT -> IO () #

getConsoleOutputCP :: IO UINT #

setConsoleOutputCP :: UINT -> IO () #

# Ctrl events

type CtrlEvent = DWORD #

cTRL_C_EVENT :: CtrlEvent #

cTRL_BREAK_EVENT :: CtrlEvent #

generateConsoleCtrlEvent :: CtrlEvent -> DWORD -> IO () #

# Command line

commandLineToArgv :: String -> IO [String] #

This function can be used to parse commandline arguments and return the split up arguments as elements in a list.

# Screen buffer

data CONSOLE_SCREEN_BUFFER_INFO #

Constructors

CONSOLE_SCREEN_BUFFER_INFO |
Fields dwSize :: COORD dwCursorPosition :: COORD wAttributes :: WORD srWindow :: SMALL_RECT dwMaximumWindowSize :: COORD

#### Instances

Instances details

Eq CONSOLE_SCREEN_BUFFER_INFO # |
Instance details Defined in System.Win32.Console Methods (==) :: CONSOLE_SCREEN_BUFFER_INFO -> CONSOLE_SCREEN_BUFFER_INFO -> Bool # (/=) :: CONSOLE_SCREEN_BUFFER_INFO -> CONSOLE_SCREEN_BUFFER_INFO -> Bool #
Show CONSOLE_SCREEN_BUFFER_INFO # |
Instance details Defined in System.Win32.Console Methods showsPrec :: Int -> CONSOLE_SCREEN_BUFFER_INFO -> ShowS Source # show :: CONSOLE_SCREEN_BUFFER_INFO -> String Source # showList :: [CONSOLE_SCREEN_BUFFER_INFO] -> ShowS Source #
Storable CONSOLE_SCREEN_BUFFER_INFO # |
Instance details Defined in System.Win32.Console Methods sizeOf :: CONSOLE_SCREEN_BUFFER_INFO -> Int Source # alignment :: CONSOLE_SCREEN_BUFFER_INFO -> Int Source # peekElemOff :: Ptr CONSOLE_SCREEN_BUFFER_INFO -> Int -> IO CONSOLE_SCREEN_BUFFER_INFO Source # pokeElemOff :: Ptr CONSOLE_SCREEN_BUFFER_INFO -> Int -> CONSOLE_SCREEN_BUFFER_INFO -> IO () Source # peekByteOff :: Ptr b -> Int -> IO CONSOLE_SCREEN_BUFFER_INFO Source # pokeByteOff :: Ptr b -> Int -> CONSOLE_SCREEN_BUFFER_INFO -> IO () Source # peek :: Ptr CONSOLE_SCREEN_BUFFER_INFO -> IO CONSOLE_SCREEN_BUFFER_INFO Source # poke :: Ptr CONSOLE_SCREEN_BUFFER_INFO -> CONSOLE_SCREEN_BUFFER_INFO -> IO () Source #

data COORD #

Constructors

COORD |
Fields x :: SHORT y :: SHORT

#### Instances

Instances details

Eq COORD # |
Instance details Defined in System.Win32.Console Methods (==) :: COORD -> COORD -> Bool # (/=) :: COORD -> COORD -> Bool #
Show COORD # |
Instance details Defined in System.Win32.Console Methods showsPrec :: Int -> COORD -> ShowS Source # show :: COORD -> String Source # showList :: [COORD] -> ShowS Source #
Storable COORD # |
Instance details Defined in System.Win32.Console Methods sizeOf :: COORD -> Int Source # alignment :: COORD -> Int Source # peekElemOff :: Ptr COORD -> Int -> IO COORD Source # pokeElemOff :: Ptr COORD -> Int -> COORD -> IO () Source # peekByteOff :: Ptr b -> Int -> IO COORD Source # pokeByteOff :: Ptr b -> Int -> COORD -> IO () Source # peek :: Ptr COORD -> IO COORD Source # poke :: Ptr COORD -> COORD -> IO () Source #

data SMALL_RECT #

Constructors

SMALL_RECT |
Fields left :: SHORT top :: SHORT right :: SHORT bottom :: SHORT

#### Instances

Instances details

Eq SMALL_RECT # |
Instance details Defined in System.Win32.Console Methods (==) :: SMALL_RECT -> SMALL_RECT -> Bool # (/=) :: SMALL_RECT -> SMALL_RECT -> Bool #
Show SMALL_RECT # |
Instance details Defined in System.Win32.Console Methods showsPrec :: Int -> SMALL_RECT -> ShowS Source # show :: SMALL_RECT -> String Source # showList :: [SMALL_RECT] -> ShowS Source #
Storable SMALL_RECT # |
Instance details Defined in System.Win32.Console Methods sizeOf :: SMALL_RECT -> Int Source # alignment :: SMALL_RECT -> Int Source # peekElemOff :: Ptr SMALL_RECT -> Int -> IO SMALL_RECT Source # pokeElemOff :: Ptr SMALL_RECT -> Int -> SMALL_RECT -> IO () Source # peekByteOff :: Ptr b -> Int -> IO SMALL_RECT Source # pokeByteOff :: Ptr b -> Int -> SMALL_RECT -> IO () Source # peek :: Ptr SMALL_RECT -> IO SMALL_RECT Source # poke :: Ptr SMALL_RECT -> SMALL_RECT -> IO () Source #

getConsoleScreenBufferInfo :: HANDLE -> IO CONSOLE_SCREEN_BUFFER_INFO #

getCurrentConsoleScreenBufferInfo :: IO CONSOLE_SCREEN_BUFFER_INFO #