本文整理汇总了C++中CButton::GetSafeHwnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::GetSafeHwnd方法的具体用法?C++ CButton::GetSafeHwnd怎么用?C++ CButton::GetSafeHwnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::GetSafeHwnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDialogClickRadioButton
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;
}
示例2: while
CBaseDialog::~CBaseDialog()
{
POSITION pos= m_wndList.GetHeadPosition();
CButton* pBtn = NULL;
while (pos)
{
pBtn = (CButton*)m_wndList.GetNext(pos);
if (pBtn->GetSafeHwnd() != NULL)
{
pBtn->UnsubclassWindow();
}
delete pBtn;
}
m_wndList.RemoveAll();
}
示例3: OnInitDialog
BOOL CServerGUIDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
CButton *pButton = (CButton *)GetDlgItem(BTN_START_SERVER);
if (pButton && pButton->GetSafeHwnd())
{
pButton->SetIcon((HICON)LoadImage(AfxGetApp()->m_hInstance,
MAKEINTRESOURCE(ID_START),
IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR));
}
serverStatus = false;
ms = new MessageSocket((CEdit*) GetDlgItem(EC_SERVER_STATUS));
return TRUE; // return TRUE unless you set the focus to a control
}