2

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 1

5

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.