本文整理汇总了C++中CEdit::GetSafeHwnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CEdit::GetSafeHwnd方法的具体用法?C++ CEdit::GetSafeHwnd怎么用?C++ CEdit::GetSafeHwnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEdit
的用法示例。
在下文中一共展示了CEdit::GetSafeHwnd方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CEdit_MoveToEnd
// http://www.stackoverflow.com/questions/1480873/cedit-control-mfc-placing-cursor-to-end-of-string-after-setwindowtext
void CEdit_MoveToEnd(CEdit &ctrlEdit)
{
ASSERT(ctrlEdit.GetSafeHwnd() != NULL);
if (ctrlEdit.GetSafeHwnd() == NULL)
return;
ctrlEdit.SetSel(0, -1);
ctrlEdit.SetSel(-1);
}
示例2: OnRename
void CLATEDView::OnRename()
{
CTreeCtrl& rTree = GetTreeCtrl();
HTREEITEM hItem = rTree.GetSelectedItem();
if(hItem == NULL) {
return;
}
CEdit* pEdit = rTree.EditLabel(hItem);
TRACE("Edit hwnd: %x\n", pEdit->GetSafeHwnd());
}
示例3: OnSize
void MyDlg_Search::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: 在此处添加消息处理程序代码
CEdit * p;
CRect rect;
p = (CEdit *)GetDlgItem(IDC_EDIT1);
if (IsWindow(p->GetSafeHwnd()))
{
p->GetWindowRect(&rect);
ScreenToClient(&rect);
::SetWindowPos(p->GetSafeHwnd(),NULL,0,0,cx-rect.left,rect.Height(),SWP_NOOWNERZORDER|SWP_NOMOVE );
}
p = (CEdit *)GetDlgItem(IDC_EDIT2);
if (IsWindow(p->GetSafeHwnd()))
{
p->GetWindowRect(&rect);
ScreenToClient(&rect);
::SetWindowPos(p->GetSafeHwnd(),NULL,0,0,cx-rect.left,rect.Height(),SWP_NOOWNERZORDER|SWP_NOMOVE );
}
p = (CEdit *)GetDlgItem(IDC_EDIT3);
if (IsWindow(p->GetSafeHwnd()))
{
p->GetWindowRect(&rect);
ScreenToClient(&rect);
::SetWindowPos(p->GetSafeHwnd(),NULL,0,0,cx-rect.left,rect.Height(),SWP_NOOWNERZORDER|SWP_NOMOVE );
}
}
示例4: PreTranslateMessage
BOOL CTabpageLend::PreTranslateMessage(MSG* pMsg)
{
CEdit* pEditId = (CEdit*)GetDlgItem(IDC_EDIT_ID);
CEdit* pEditGunId = (CEdit*)GetDlgItem(IDC_EDIT_GUN);
if (pEditId != NULL && pMsg->hwnd == pEditId->GetSafeHwnd()
&& VK_RETURN == pMsg->wParam)
{
CString id;
pEditId->GetWindowTextW(id);
DoIDInput(id);
return TRUE;
}
else if (pEditGunId != NULL && pMsg->hwnd == pEditGunId->GetSafeHwnd()
&& VK_RETURN == pMsg->wParam)
{
CString gunId;
pEditGunId->GetWindowTextW(gunId);
DoGunIDInput(gunId);
return TRUE;
}
return CDialogEx::PreTranslateMessage(pMsg);
}
示例5: PreTranslateMessage
BOOL CTabpageBorrow::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
CEdit* pEditId = (CEdit*)GetDlgItem(IDC_EDIT_ID_IN_BORROW);
CEdit* pEditGunId = (CEdit*)GetDlgItem(IDC_EDIT_GUN);
if (pEditId != NULL && pMsg->hwnd == pEditId->GetSafeHwnd()
&& VK_RETURN == pMsg->wParam)
{
CString id;
pEditId->GetWindowTextW(id);
DoIDInput(id);
return TRUE;
}
else if (pEditGunId != NULL && pMsg->hwnd == pEditGunId->GetSafeHwnd()
&& VK_RETURN == pMsg->wParam)
{
CString gunId;
pEditGunId->GetWindowTextW(gunId);
DoGunIDInput(gunId);
return TRUE;
}
return CDialogEx::PreTranslateMessage(pMsg);
}
示例6: OnSize
// CArbiReportDlg 消息处理程序
void CArbiReportDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CDialog::OnSize(nType, cx, cy);
if (GetSafeHwnd())
{
CEdit * peditLog = (CEdit*)GetDlgItem(IDC_EDIT_LOG);
if (peditLog->GetSafeHwnd())
{
CRect rect(0,0,cx,cy);
peditLog->MoveWindow(&rect);
}
}
}