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...
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...