Get all control IDs of MFC dialog box

Is there some way to get all control IDs of current MFC dialog box? (to change WindowText of all controls)

Upvotes: 0

Views: 1331

Answers (1)

Flaviu_
Flaviu_

Reputation: 1346

You can do something like that:

for(CWnd* pWnd = GetWindow(GW_CHILD); pWnd != NULL; pWnd = pWnd->GetWindow(GW_HWNDNEXT))
{
    pWnd->SetWindowText(_T("MyText"));
}

Of course, you can check ID or type of control id if you need.

Upvotes: 3

Related Questions