当前位置: 首页>>代码示例>>C++>>正文


C++ CEdit::GetSafeHwnd方法代码示例

本文整理汇总了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);
}
开发者ID:myd7349,项目名称:Ongoing-Study,代码行数:10,代码来源:MFCExtensions.cpp

示例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());
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:12,代码来源:latedview.cpp

示例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 );
	}
}
开发者ID:johnzhd,项目名称:doc_tools,代码行数:34,代码来源:MyDlg_Search.cpp

示例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);
}
开发者ID:zinsser,项目名称:KingSpace,代码行数:22,代码来源:TabpageLend.cpp

示例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);
}
开发者ID:zinsser,项目名称:KingSpace,代码行数:23,代码来源:TabpageBorrow.cpp

示例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);
		}
	}
}
开发者ID:marco-sun,项目名称:arbi6,代码行数:17,代码来源:ArbiReportDlg.cpp


注:本文中的CEdit::GetSafeHwnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。