简体   繁体   English

haskell中的win32 SetForegroundWindow

[英]win32 SetForegroundWindow in haskell

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. 我注意到Haskell Win32 api没有SetForegroundWindow函数,并且我对Haskell不够熟练,无法自己添加此功能。 Would there be any way to replicate this using haskell or has any one made their own wrapper using ffi? 是否有任何方法可以使用haskell复制此文件,或者有任何人可以使用ffi制作自己的包装器?

Here's a simple wrapper using the FFI: 这是使用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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM