[haskell-cafe] Finding a PID in Windows

Bulat Ziganshin bulat.ziganshin at gmail.com
Sun Feb 22 11:52:21 EST 2009

Hello Alexandru,

Sunday, February 22, 2009, 7:38:31 PM, you wrote:

> In Linux, if you want to find the PID of a process, you use getProcessID from

"The GetCurrentProcessId function returns the process identifier of the calling process.
 DWORD GetCurrentProcessId(VOID)"

you need to make FFI import yourself. look Win32 package sources for
examples of how to do it. in this case:

foreign import stdcall unsafe "winbase.h GetCurrentProcessId"
    c_GetCurrentProcessId :: IO DWORD

if you are going to use win32 system calls, i recommend you to find
helpfiles from win32 sdk, they contain all those info. or you may use
msdn on the web and search there

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list