"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
I'd using WMI in a couple of projects and notice about real differences
between OSes. Are there any other way?
There is no direct way to do this using Managed code nor WMI (well, you can
get a list of processes and threads using WMI), your only option is to use
unmanaged code, provided you have the necessary privileges to control other
processes/threads, here's what you have to do:
1. (Using WMI) Get a list of processes you need to suspend.
2. (Using WMI) For each in 1, get associated thread ID's.
3. Get thread handle from threadID by caling Win32 API OpenThread.
3. Call Win32 API SuspendThread using the thread handles from 2
4. Do your thing....
5. Call Win32 API ResumeThread using the same thread handles as in 3.
Willy.