資源簡介
Windows平臺下的圖形化的Ping工具(基于MFC的Dialog工程)

代碼片段和文件信息
//?AutoCompleteComboBox.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“WinPing.h“
#include?“AutoCompleteComboBox.h“
//?CAutoCompleteComboBox
IMPLEMENT_DYNAMIC(CAutoCompleteComboBox?CComboBox)
CAutoCompleteComboBox::CAutoCompleteComboBox()
{
m_bAutoComplete?=?TRUE;
}
CAutoCompleteComboBox::~CAutoCompleteComboBox()
{
}
BEGIN_MESSAGE_MAP(CAutoCompleteComboBox?CComboBox)
ON_CONTROL_REFLECT(CBN_EDITUPDATE?&CAutoCompleteComboBox::OnEditUpdate)
END_MESSAGE_MAP()
//?CAutoCompleteComboBox?message?handlers
BOOL?CAutoCompleteComboBox::PreTranslateMessage(MSG?*pMsg)
{
if(WM_KEYDOWN?==?pMsg->message)
{
m_bAutoComplete?=?TRUE;
if((VK_DELETE?==?pMsg->wParam)?||?(VK_BACK?==?pMsg->wParam))
{
m_bAutoComplete?=?FALSE;
}
}
return?CComboBox::PreTranslateMessage(pMsg);
}
void?CAutoCompleteComboBox::OnEditUpdate()
{
if(!m_bAutoComplete)
{
return?;
}
CString?strText(_T(““));
GetWindowText(strText);
int?nLen?=?strText.GetLength();
DWORD?dwCurSel?=?GetEditSel();
WORD?wStart?=?LOWORD(dwCurSel);
WORD?wEnd?=?HIWORD(dwCurSel);
if(CB_ERR?==?SelectString(-1?strText))
{
SetWindowText(strText);
if(CB_ERR?!=?dwCurSel)
{
SetEditSel(wStart?wEnd);
}
}
if((wEnd? {
SetEditSel(wStart?wEnd);
}
else
{
SetEditSel(nLen?-1);
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1393??2010-04-20?15:13??WinPing\AutoCompleteComboBox.cpp
?????文件????????388??2010-04-20?15:07??WinPing\AutoCompleteComboBox.h
?????文件???????2351??2010-04-20?14:11??WinPing\ProtoInfo.cpp
?????文件???????1612??2010-04-20?13:50??WinPing\ProtoInfo.h
????.......?????67777??2007-11-28?16:21??WinPing\res\WinPing.ico
?????文件????????398??2010-04-20?10:53??WinPing\res\WinPing.rc2
?????文件????????771??2010-04-20?10:56??WinPing\resource.h
?????文件????????209??2010-04-20?10:53??WinPing\stdafx.cpp
?????文件???????2029??2010-04-20?10:53??WinPing\stdafx.h
?????文件???????1432??2010-04-20?10:53??WinPing\targetver.h
?????文件???????2678??2010-04-20?11:17??WinPing\WinPing.cpp
?????文件?????170496??2010-04-20?17:38??WinPing\WinPing.exe
?????文件????????609??2010-04-20?11:15??WinPing\WinPing.h
?????文件???????5849??2010-04-20?17:35??WinPing\WinPing.rc
?????文件????????879??2010-04-20?10:53??WinPing\WinPing.sln
????..A..H.?????14848??2010-04-20?17:56??WinPing\WinPing.suo
?????文件???????5778??2010-04-20?15:13??WinPing\WinPing.vcproj
?????文件??????10254??2010-04-20?17:25??WinPing\WinPingDlg.cpp
?????文件????????989??2010-04-20?15:16??WinPing\WinPingDlg.h
?????目錄??????????0??2010-04-20?17:57??WinPing\Debug
?????目錄??????????0??2010-04-20?10:53??WinPing\res
?????目錄??????????0??2010-04-20?17:57??WinPing
-----------?---------??----------?-----??----
???????????????290740????????????????????22
- 上一篇:PBIL算法源代碼C++
- 下一篇:VC++病毒編程入門
評論
共有 條評論