A
arganx
The conditional statement "if(j.... always executes regardless of what
you enter.
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buffer[256]="";
GetWindowText(hwnd,buffer,256);
if(!strcmp(buffer,""))
{
return TRUE;
}
printf("%d. %s\n",i,buffer);
cout << "is this it?: " << flush;
int j = 0;
cin >> j;
cout << endl;
if (j=1) cout << hwnd << buffer << endl; //This always excecutes
//regardless of input
i++;
return TRUE;
}
Futher, if you change it to "int j = 1", it will never execute -
regardless of imput.
Any help would be appreciated.
you enter.
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
char buffer[256]="";
GetWindowText(hwnd,buffer,256);
if(!strcmp(buffer,""))
{
return TRUE;
}
printf("%d. %s\n",i,buffer);
cout << "is this it?: " << flush;
int j = 0;
cin >> j;
cout << endl;
if (j=1) cout << hwnd << buffer << endl; //This always excecutes
//regardless of input
i++;
return TRUE;
}
Futher, if you change it to "int j = 1", it will never execute -
regardless of imput.
Any help would be appreciated.