I've noticed the Haskell Win32 api does not have a SetForegroundWindow
function and I'm not skilled enough in haskell to add this feature myself. Would there be any way to replicate this using haskell or has any one made their own wrapper using ffi?
1 Answer
Here's a simple wrapper using the FFI:
{-# LANGUAGE ForeignFunctionInterface #-}
module SetForegroundWindow
( setForegroundWindow
) where
import Foreign
import Graphics.Win32
foreign import stdcall safe "windows.h SetForegroundWindow"
c_setForegroundWindow :: HWND -> IO Bool
setForegroundWindow :: HWND -> IO Bool
setForegroundWindow = c_setForegroundWindow
-
awesome! you should contribute this to the win32 github page,github.com/haskell/win32/blob/master/Graphics/Win32/Window.hsc– pyCthonJan 12, 2013 at 21:05
-
-
1