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
3 Comments
pyCthon
awesome! you should contribute this to the win32 github page,github.com/haskell/win32/blob/master/Graphics/Win32/Window.hsc
ДМИТРИЙ МАЛИКОВ
@pyCthon but why don't you contribute it by yourself?
pyCthon
@ДМИТРИЙМАЛИКОВ МАЛИКОВ I don't want so take credit for his work