CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    1,793

    Weird question??

    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


    [email protected]
    http://www.path.co.il
    ICQ: 13610258

  2. #2
    Join Date
    Sep 1999
    Posts
    56

    Re: Weird question??

    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






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured