Win32-2.6.2.1: A binding to Windows Win32 API.
Copyright(c) Alastair Reid 1997-2003
LicenseBSD-style (see the file libraries/base/LICENSE)
MaintainerEsa Ilari Vuokko <ei@vuokko.info>
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

System.Win32.Types

Description

A collection of FFI declarations for interfacing with Win32.

Synopsis

Documentation

type SortID = WORD #

type LANGID = WORD #

type LCID = DWORD #

type ErrCode = DWORD #

type HMODULE = Ptr () #

type HINSTANCE = Ptr () #

type PKEY = HANDLE #

type HANDLE = Ptr () #

type TCHAR = CWchar #

type LPTSTR = Ptr TCHAR #

type LPCSTR = LPSTR #

type LPSTR = Ptr CChar #

type PUCHAR = Ptr UCHAR #

type LPBYTE = Ptr BYTE #

type LPBOOL = Ptr BOOL #

type LPVOID = Ptr () #

type Addr = Ptr () #

type HRESULT = LONG #

type ATOM = WORD #

type MbINT = Maybe INT #

type DDWORD = Word64 #

type UINT_PTR = Word #

type ULONG = Word32 #

type INT_PTR = Ptr CInt #

type SHORT = Int16 #

type UINT64 = Word64 #

type UINT32 = Word32 #

type LONG64 = Int64 #

type LONG32 = Int32 #

type INT64 = Int64 #

type INT32 = Int32 #

type FLOAT = Float #

type LONG = Int32 #

type DWORD = Word32 #

type WORD = Word16 #

type INT = Int32 #

type UINT = Word32 #

type USHORT = Word16 #

type UCHAR = CUChar #

type BYTE = Word8 #

type BOOL = Bool #

localFree :: Ptr a -> IO (Ptr a) #

maybePtr :: Maybe (Ptr a) -> Ptr a #

ptrToMaybe :: Ptr a -> Maybe (Ptr a) #

maybeNum :: Num a => Maybe a -> a #

numToMaybe :: (Eq a, Num a) => a -> Maybe a #

withTString :: String -> (LPTSTR -> IO a) -> IO a #

withTStringLen :: String -> ((LPTSTR, Int) -> IO a) -> IO a #

hANDLEToHandle :: HANDLE -> IO Handle #

Create a Haskell Handle from a Windows HANDLE.

Beware that this function allocates a new file descriptor. A consequence of this is that calling hANDLEToHandle on the standard Windows handles will not give you stdin, stdout, or stderr. For example, if you run this code:

import Graphics.Win32.Misc
stdoutHANDLE <- getStdHandle sTD_OUTPUT_HANDLE
stdout2 <- hANDLEToHandle stdoutHANDLE

Then although you can use stdout2 to write to standard output, it is not the case that stdout == stdout2.

withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a #

Extract a Windows HANDLE from a Haskell Handle and perform an action on it.

withStablePtr :: a -> (StablePtr a -> IO b) -> IO b #

failIf :: (a -> Bool) -> String -> IO a -> IO a #

failIf_ :: (a -> Bool) -> String -> IO a -> IO () #

failIfNeg :: (Num a, Ord a) => String -> IO a -> IO a #

failIfNull :: String -> IO (Ptr a) -> IO (Ptr a) #

failIfZero :: (Eq a, Num a) => String -> IO a -> IO a #

try :: String -> (LPTSTR -> UINT -> IO UINT) -> UINT -> IO String #

nullPtr :: Ptr a Source #

The constant nullPtr contains a distinguished value of Ptr that is not associated with a valid memory location.