i'm trying create a class for getting the child controls from it's parent, but without sucess :(
class ChildControls
{
private:
vector<HWND> childcontrols;
UINT childcontrolsindex;
HWND windowparent;
public:
ChildControls(const HWND parent)
{
windowparent=parent;
//EnumChildWindows(parent, EnumChildProc, 0);
}
UINT childcontrolscount()
{
return childcontrolsindex;
}
HWND GetHWND(UINT index)
{
EnumChildWindows( windowparent,
[this]( HWND hwnd, LPARAM lParam )
{
this->childcontrols.push_back(hwnd);
this->childcontrolsindex = this->childcontrols.size(); // TODO:
return TRUE;
},
0);
if(index>=childcontrolsindex)
index=childcontrolsindex-1;
return childcontrols[index];
}
}ChildControls;
EnumChildWindows() isn't correct with 3rd and 4th arguments :(
please can anyone advice me?