November 19th, 2012, 01:03 PM
Find 2 process with the same name
OK i have 2 process with same name, i use FindWindow but i find the wrong one, i dont know how to skip to the next process,
my code :
HWND hGame = NULL;
hGame = FindWindow(NULL,L"AssaultCube");
printf("Game Open failed");
November 19th, 2012, 01:41 PM
I don't know what FindWindow does, and I'm not going to look it up.
I'd get a list of processes and scan that list.
I'm sure Windows has a command to list processes because I once removed a virus that ran two processes. As soon as I'd kill one the other would start a second process with a different name. No way to stop them by hand through the task manager gui so I wrote a batch script that reduced their process priority then killed them.
[/code] are essential for python code and Makefiles!
November 19th, 2012, 01:46 PM
I sense a presence in the source, a feeling that I've seen this all before
> hGame = FindWindow(NULL,L"AssaultCube");
Did you read the manual page?
A really useful feature on most manual pages are the "See also" links to related functions. Having found that FindWindow is close, but not quite what you want, the next best thing to do is go and read what the related functions do. If you dig into it a bit, you should find what you need.
November 19th, 2012, 02:26 PM
if u dont know what my code does dont waste my time with useless post, at least do a favor and read one function with 2 fking parameters.
Originally Posted by b49P23TIvg
anyway cant kill any of them, cuz 1 is the logs of the other, kill the logs, kill the process i want. cant be done.
of course i read it, i have two windows under the same name, so i find the pid i dont want, i need the other to write into.
Originally Posted by salem
i asked, FindWindow probably get 2 process, how do i make him read the other two.
Comments on this post
November 19th, 2012, 06:49 PM
I thought I would post a vague resolution to your problem. The solution is as follows:
Call EnumWindows from within a CALLBACK function to enumerate all open windows.
I'd post a lot more detail, possibly a complete code sample but your attitude just irks me.