>>if (!"\EvolveTraffic.exe")
What is the world is that supposed to do ????
>>HWND hWnd = ::FindWindow(NULL,"EvolveTraffic.exe");
FindWindow() looks at the window's title, not the name of the executable. As a test, write a short program that calls EnumWindows() and see all the values that it returns. Run the program below and pick the title of the window you want to pass to FindWindow()
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char text[255];
GetWindowText(hwnd, text, sizeof(text));
if( text[0] != 0 && !strstr(text,"Default") )
std::cout << text << "\n";
return TRUE;
}
int main()
{
EnumWindows(EnumWindowsProc, 0);
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>>"\EvolveTraffic.exe"
Remove the \ character. Looks like a typo, but check the code you actually wrote.
>>sorry I'm abit lost, lots of new functions
Only one or two. Read all about them on MSDN. Also write your own little programs to test and try them out so you can understand them better.
>>Surely the FindWindow() function will only work if the .exe file is open??
Well yes, and the executable must be a windows program. It won't work with console programs because EnumWindows() only shows "C:\Windows\system32\cmd.exe", which isn't much help.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
laconstantine
Junior Poster in Training
70 posts since May 2007
Reputation Points: 10
Solved Threads: 1
this thread is so *** up
I suppose you got lost somewhere. If its beyond your comprehension then I'd suggest you don't read it. You need more than 1st grade reading skills for this thread :)
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343