LRESULT CXTPTaskDialogFrame::OnDialogClickRadioButton(WPARAM wParam, LPARAM /*lParam*/)
{
    CButton* pWnd = DYNAMIC_DOWNCAST(CButton, GetDlgItem((UINT)wParam));
    if (!pWnd)
        return FALSE;

    if ((pWnd->SendMessage(WM_GETDLGCODE) & DLGC_RADIOBUTTON) == 0)
        return FALSE;

    HWND hWndCtrl = ::GetWindow(m_hWnd, GW_CHILD);

    while (hWndCtrl)
    {
        if (::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON)
        {
            ::SendMessage(hWndCtrl, BM_SETCHECK, hWndCtrl == pWnd->GetSafeHwnd(), 0L);
        }
        hWndCtrl = ::GetWindow(hWndCtrl, GW_HWNDNEXT);
    }

    m_nSelRadioButtonID = (UINT)wParam;
    SendNotify(TDN_RADIO_BUTTON_CLICKED, (WPARAM)m_nSelRadioButtonID);

    return TRUE;
}
LRESULT CXTPTaskDialogFrame::OnDialogSetButtonElevationState(WPARAM wParam, LPARAM lParam)
{
    CButton* pWnd = DYNAMIC_DOWNCAST(CButton, GetDlgItem((UINT)wParam));
    if (!pWnd)
        return FALSE;

    pWnd->SendMessage(BCM_SETSHIELD, 0, lParam);

    return TRUE;
}
LRESULT CXTPTaskDialogFrame::OnDialogEnableRadioButton(WPARAM wParam, LPARAM lParam)
{
    CButton* pWnd = DYNAMIC_DOWNCAST(CButton, GetDlgItem((UINT)wParam));
    if (!pWnd)
        return FALSE;

    if ((pWnd->SendMessage(WM_GETDLGCODE) & DLGC_RADIOBUTTON) == 0)
        return FALSE;

    pWnd->EnableWindow(lParam != 0);

    return TRUE;
}
Ejemplo n.º 4
0
void NewGUI_SetShield(CButton& rButton, BOOL bSetShield)
{
	rButton.SendMessage(BCM_SETSHIELD, 0, bSetShield);
}