Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Look through all open windows...

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Nov 23, 2003
249
US
How would I scan all open window titles for a particular item? Not sure if I am doing it right but here is my attempt: (RecordList is a list box, and the entry in the list box as the indentical title of the window)

CString CurrentRecord,Title;
RecordList.GetText(RecordList.GetCurSel(),CurrentRecord);
CWnd *myWnd;
while(GetNextWindow(GW_HWNDNEXT!=NULL)
{ myWnd= new CWnd();
myWnd=GetNextWindow(GW_HWNDNEXT);
myWnd->GetWindowText(Title);
if (!(strcmp(CurrentRecord,Title))) { mParent->UpdateDebug("Found: " +Title); myWnd->SetFocus(); break; }
}

}

Where am I going wrong?

Thanks,
Ron

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top