Click to See Complete Forum and Search --> : Weird question??


kishk91
September 23rd, 1999, 07:51 AM
Hi there.
mybe its a dumb question
but iv been wondering about it for a while.
i try to build some activeX control.
so far its working fine.
but my question is (not about activeX YET..)
when i edit my dialog boxes in the dialog editor (Vc6)
i can put all kind of controls (not activeX controls)
lets say that i put 5 radios 5 check boxes and 5 edit boxes.

how can i enum (or something like that) the control get its HWND or CWnd* and then SORT them by type.
i need to create dynamic list for each control
is it possible to do so?

thanks
kishk91


kishk91@hotmail.com
http://www.path.co.il
ICQ: 13610258

Paulvdb
September 23rd, 1999, 09:54 AM
Hi,

Maybe this code might help.

in the OnInitDialog


::EnumChildWindows(this->m_hWnd, EnumChildProc, 0);




and for the callback function


BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam)
{
char szClassName[64];

::GetClassName(hWnd, szClassName, sizeof(szClassName));
if (!(lstrcmpi("button", szClassName)))
{
lStyle = GetWindowLong(hWnd, GWL_STYLE);
if ( ((lStyle & BS_AUTORADIOBUTTON) == BS_AUTORADIOBUTTON) ||
((lStyle & BS_RADIOBUTTON) == BS_RADIOBUTTON) )
{
...
}
else
{
...
}
}
// "edit"
}




Good Luck

Paul