enumwindow

A

arganx

Well, I'm stumped. I'm trying to find whether a child window is
visible. I have the name of the parent window and the child window. I
figured the way to do this is to first to find find the handle of the
parent window by matching the parent window name with the name that I
know. Then I could find the child window in a like manner. The
problem is - it never makes a match. Here is partial code:


char buffer[256]="";
int i=0;
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam);

int main()
{

cout << "enter target parent: " << flush;
string s;
getline(cin,s);

EnumWindows(EnumWindowsProc,0);


return 0;
} //end of main

BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
GetWindowText(hwnd,buffer,256);
if(!strcmp(buffer,""))
{
return TRUE;
}

printf(" %s\n",i,buffer); // Prints fine

if (s == buffer) cout << "found it"; // Never happens!

i++;

return TRUE;
}


I've spent hours at Microsoft trying to figure it out, but can't. Any
help would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top