packages feed

Win32-extras-0.1.0.0: Graphics/Win32/Compat.hs

{-# LANGUAGE CApiFFI #-}
{- |
   Module      :  Graphics.Win32.Compat
   Copyright   :  2013 shelarcy
   License     :  BSD-style

   Maintainer  :  shelarcy@gmail.com
   Stability   :  Provisional
   Portability :  Non-portable (Win32 API)

   Provide 64 bit compatible functions.
-}

module Graphics.Win32.Compat
  ( c_SetWindowLongPtr
  , c_GetWindowLongPtr
  ) where
import Graphics.Win32            ( HWND )
import System.Win32.Types        ( INT )
import System.Win32.Types.Compat ( LONG_PTR )

-- | We should use this instead of "Graphics.Win32.Window" module's one.
-- "Graphics.Win32.Window" module's function type is wrong.
foreign import capi "windows.h SetWindowLongPtrW"
  c_SetWindowLongPtr :: HWND -> INT -> LONG_PTR -> IO LONG_PTR

foreign import capi "windows.h GetWindowLongPtrW"
  c_GetWindowLongPtr :: HWND -> INT -> IO LONG_PTR