detetect windows form

is posible to detect if is open a program like notepad? or messenger? who?
is posible to detect if is open a program like notepad? or messenger? who?


Yes, it is possible. Use CreateToolhelp32Snapshot() (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682489(v=vs.85).aspx ) with the flag TH32CS_SNAPPROCESS. Then use Process32First() and Process32Next() to enumerate all running processes. While enumerating processes, see if the one you seek is running.
That last part of your question is catching my attention. Do you want to know who is running the process on the system? Because this is also possible but it takes a little bit more work.
Maybe he meant "how"... Check his english o.O
I agree, is possilble the OP meant to type "how" but "who" makes this a slightley more interesting question. It's only a few more functions to get the process token, convert it to the SID and look it up, but I think it's cool to be able to do stuff like this.
Topic archived. No new replies allowed.