Haskell中的Win32 API调用?

2024-04-19 23:15:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我如何在Haskell中复制这个Python呢?我已经能够掌握所有其他进程启动位,但这一个是难以捉摸的-它似乎没有在任何现有包的api。我能找到的最接近的东西是this example,但我很难适应它。你知道吗

import ctypes
ctypes.windll.kernel32.SetErrorMode(2);

Tags: importapi进程haskellexamplethisctypeswindll
1条回答
网友
1楼 · 发布于 2024-04-19 23:15:10

Foreign_Function_Interface文章提到了国外import语句的stdcall关键字。在你的情况下这看起来像

import System.Win32.Types (DWORD)

foreign import stdcall unsafe "SetErrorMode"
    win32_setErrorMode :: DWORD -> IO DWORD

相关问题 更多 >