Finding a PID in Windows

Quick question. In Linux, if you want to find the PID of a process, you use getProcessID from System.Posix.Process. How do you do the same under Windows? I cannot find the equivalent function in System.Win32 and searching Google does not yield any useful results. Thanks.

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@gmail.com
participants (2)
-
Alexandru Scvortov
-
Bulat Ziganshin