enumwindow

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arganx

    enumwindow

    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(Enu mWindowsProc,0) ;


    return 0;
    } //end of main

    BOOL CALLBACK EnumWindowsProc (HWND hwnd,LPARAM lParam)
    {
    GetWindowText(h wnd,buffer,256) ;
    if(!strcmp(buff er,""))
    {
    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.

  • Jonathan Mcdougall

    #2
    Re: enumwindow

    arganx wrote:[color=blue]
    > Well, I'm stumped. I'm trying to find whether a child window is
    > visible.[/color]




    Jonathan

    Comment

    • red floyd

      #3
      Re: enumwindow

      arganx wrote:[color=blue]
      > [redacted][/color]

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

      comp.os.ms-windows.program mer.

      Comment

      • arganx

        #4
        Re: enumwindow

        Thanks, and sorry.

        Comment

        Working...