By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,498 Members | 1,740 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,498 IT Pros & Developers. It's quick & easy.

enumwindow

P: n/a
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.

Nov 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
arganx wrote:
Well, I'm stumped. I'm trying to find whether a child window is
visible.


http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Jonathan

Nov 22 '05 #2

P: n/a
arganx wrote:
[redacted]


And you're lost now, because you're in the wrong newsgroup
Try

comp.os.ms-windows.programmer.
Nov 22 '05 #3

P: n/a
Thanks, and sorry.

Nov 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.