ActiveWindow* ActiveWindow::FindChild(DWORD id) { ListIter<ActiveWindow> iter = children; while (++iter) { ActiveWindow* w = iter.value(); if (w->GetID() == id) return w; ActiveWindow* w2 = w->FindChild(id); if (w2) return w2; } return 0; }
ActiveWindow* FormWindow::FindControl(int x, int y) { ActiveWindow* mouse_tgt = 0; ListIter<ActiveWindow> iter = children; while (++iter) { ActiveWindow* test = iter.value(); if (test->TargetRect().Contains(x,y)) { mouse_tgt = test; while (test) { test = test->FindChild(x,y); if (test) mouse_tgt = test; } } } return mouse_tgt; }