• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ AfxExtractSubString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AfxExtractSubString函数的典型用法代码示例。如果您正苦于以下问题:C++ AfxExtractSubString函数的具体用法?C++ AfxExtractSubString怎么用?C++ AfxExtractSubString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AfxExtractSubString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AfxExtractSubString

void CDataCeneter::GetMailServer(BYTE bOperation, LPVOID VarData)
{
	struMail *pMailData = (struMail*)VarData;

	TCHAR szData[1024] = {0};
	ULONG ulChars = 1024;
	CRegKey regKey;

	if( regKey.Open(HKEY_LOCAL_MACHINE, GetRegFolder()) == ERROR_SUCCESS)
	{
		regKey.QueryStringValue(_T("SMTPSETTING"), szData,&ulChars);
	}
	regKey.Close();

	CString csSMTPSecure, csSMTPServer, csSMTPPort, csSMTPAccount, csSMTPPassword;
	AfxExtractSubString(csSMTPSecure, szData, 0, ';');
	AfxExtractSubString(csSMTPServer, szData, 1, ';');
	AfxExtractSubString(csSMTPPort, szData, 2, ';');
	AfxExtractSubString(csSMTPAccount, szData, 3, ';');
	AfxExtractSubString(csSMTPPassword, szData, 4, ';');

	pMailData->SMTPSecure = (SMTP_SECURE)_ttoi(csSMTPSecure);
	pMailData->SMTPServer = csSMTPServer;
	pMailData->SMTPPort = csSMTPPort;
	pMailData->SMTPAccount = csSMTPAccount;
	pMailData->SMTPPassword = csSMTPPassword;
}
开发者ID:ChangChingHan,项目名称:MFCComClient,代码行数:27,代码来源:RegTable.cpp


示例2: _T

/* extract CSV items using undocumented 'AfxExtractSubString()' to speed up (maybe) */
bool	CCsvFile::GetItem(CStringW &item, const CStringW &line, WORD &index)
{
	CStringW last_item;
	bool	ret = false;

	last_item.Empty();
	if(!AfxExtractSubString(item,line,index,','))
		return false;

	if(item.Left(1) == _T("\""))
	{
		do
		{
			if(item.Right(1) == _T("\""))
			{
				if(!last_item.IsEmpty())
					item = last_item + item;
				item.Trim(_T("\""));
				ret = true;
				break;
			}
			last_item += item + _T(",");
		}
		while(AfxExtractSubString(item,line,++index,','));
	}
	else
		ret = true;
	return ret;
}
开发者ID:yunhaisoft,项目名称:aoctm,代码行数:30,代码来源:CsvFile.cpp


示例3: GetLatestVersionInfo

BOOL CDialogCheckUpdate::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	CString strLatestVersionInfo = GetLatestVersionInfo(UIDESIGNER_VERSION_CHECK_URL);
	CString strLastestVersion;
	CString strUpdateURL;
	AfxExtractSubString(strLastestVersion,strLatestVersionInfo, 0, '|');
	AfxExtractSubString(strUpdateURL,strLatestVersionInfo, 1, '|');
	this->GetDlgItem(IDC_STATIC_CURRENT_VERSION)->SetWindowText(UIDESIGNER_VERSION);
	this->GetDlgItem(IDC_STATIC_LATEST_VERSION)->SetWindowText(strLastestVersion);
	CWnd* pWndInfo = this->GetDlgItem(IDC_STATIC_UPDATE_INFO);
	if(strLatestVersionInfo.IsEmpty())
		pWndInfo->SetWindowText(_T("检查新版本失败!"));
	else if(strLastestVersion == UIDESIGNER_VERSION)
		pWndInfo->SetWindowText(_T("您的版本已经是最新!"));
	else
	{
		m_btnUpdateURL.SetURL(strUpdateURL);
		m_btnUpdateURL.SetTooltip(_T("下载最新版本"));
		m_btnUpdateURL.SizeToContent();
		m_btnUpdateURL.ShowWindow(SW_SHOW);
		pWndInfo->SetWindowText(_T("新版本可供下载!"));
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:29,代码来源:DialogCheckUpdate.cpp


示例4: AfxExtractSubString

//******************************************************************************
void CBCGPRadialMenuItem::UpdateToolTip()
{
	CString strText;
	if (!strText.LoadString (m_nID))
	{
		return;
	}

	m_strToolTip.Empty ();
	m_strDescription.Empty ();

	if (strText.IsEmpty ())
	{
		return;
	}

	AfxExtractSubString (m_strDescription, strText, 0);
	AfxExtractSubString (m_strToolTip, strText, 1, '\n');

	const CString strDummyAmpSeq = _T("\001\001");

	m_strToolTip.Replace (_T("&&"), strDummyAmpSeq);
	m_strToolTip.Remove (_T('&'));
	m_strToolTip.Replace (strDummyAmpSeq, _T("&"));
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:26,代码来源:BCGPRadialMenu.cpp


示例5: MgpEnumerateSystemPorts

void CMainDlg::OnBnClickedBtRescan()
{
	CStringList ports;
	CString str, port, name;
	int ix, num, sel=0;
	
	m_comPorts.ResetContent();

	MgpEnumerateSystemPorts(_T("Ports"), _T("COM"), &ports);

	POSITION pos = ports.GetHeadPosition();

	while(pos)
	{
		str = ports.GetNext(pos);
		AfxExtractSubString(port, str, 0, '\n');
		AfxExtractSubString(name, str, 1, '\n');

		if(_stscanf(port, _T("COM%i"), &num) == 1)
		{
			ix = m_comPorts.AddString(name);
			m_comPorts.SetItemData(ix, (LPARAM) num);

			if(name.Find(_T("Bootloader")) >= 0)
			{
				sel = ix;
			}
		}
	}

	m_comPorts.SetCurSel(sel);
}
开发者ID:abidbodal,项目名称:firmware_upgrader_k20,代码行数:32,代码来源:MainDlg.cpp


示例6: loadHistory

BOOL CConnectRemoteMachineWindow::OnInitDialog()
{
	CDialog::OnInitDialog();
	
	m_port.SetWindowTextW(L"20099");

	loadHistory();

	int i = 0;
	std::deque<CString>::iterator iter = m_historyCommand.begin();
	for(; iter != m_historyCommand.end(); iter++)
	{
		if(i == 0)
		{
			CString output = L"";
			CString output1 = L"";
			AfxExtractSubString(output, (*iter), 0, _T(':'));
			AfxExtractSubString(output1, (*iter), 1, _T(':'));

			char* ip = KBEngine::strutil::wchar2char(output.GetBuffer(0));
			m_ip.SetAddress(ntohl(inet_addr(ip)));
			free(ip);

			m_port.SetWindowTextW(output1);
		}

		i++;
		m_log.AddString((*iter));
	}

	return TRUE;  // return TRUE  unless you set the focus to a control
}
开发者ID:KitoHo,项目名称:kbengine,代码行数:32,代码来源:ConnectRemoteMachineWindow.cpp


示例7: AfxUnregisterShellFileTypes

void AfxUnregisterShellFileTypes()
{
	CString strPathName, strTemp;

	AfxGetModuleShortFileName(AfxGetInstanceHandle(), strPathName);

	CString	strMainFrame;
	VERIFY(strMainFrame.LoadString( IDR_MAINFRAME ));

	CString strFilterExt, strFileTypeId, strFileTypeName;
	if (AfxExtractSubString( strFileTypeId,strMainFrame,
	   CDocTemplate::regFileTypeId) && !strFileTypeId.IsEmpty())
	{
		// enough info to register it
		if (!AfxExtractSubString( strFileTypeName, strMainFrame,
		   CDocTemplate::regFileTypeName))
			strFileTypeName = strFileTypeId;    // use id name

		ASSERT(strFileTypeId.Find(' ') == -1);  // no spaces allowed

		strTemp.Format(_afxDefaultIconFmt, (LPCTSTR)strFileTypeId);
		AfxDeleteRegKey(strTemp);

		// path\shell\open\command = path filename
		strTemp.Format(_afxShellOpenFmt, (LPCTSTR)strFileTypeId,
			(LPCTSTR)_afxCommand);
		AfxDeleteRegKey(strTemp);

		// path\shell\print\command = path /p filename
		strTemp.Format(_afxShellPrintFmt, (LPCTSTR)strFileTypeId,
			(LPCTSTR)_afxCommand);
		AfxDeleteRegKey(strTemp);

		// path\shell\printto\command = path /pt filename printer driver port
		strTemp.Format(_afxShellPrintToFmt, (LPCTSTR)strFileTypeId,
			(LPCTSTR)_afxCommand);
		AfxDeleteRegKey(strTemp);

		AfxExtractSubString( strFilterExt, strMainFrame, CDocTemplate::filterExt);
		if (!strFilterExt.IsEmpty())
		{
			ASSERT(strFilterExt[0] == '.');

			LONG lSize = _MAX_PATH * 2;
			LONG lResult = ::RegQueryValue(HKEY_CLASSES_ROOT, strFilterExt,
				strTemp.GetBuffer(lSize), &lSize);
			strTemp.ReleaseBuffer();

			if (lResult != ERROR_SUCCESS || strTemp.IsEmpty() ||
				strTemp == strFileTypeId)
			{
				strTemp.Format(_afxShellNewFmt, (LPCTSTR)strFilterExt);
				AfxDeleteRegKey(strTemp);

				// no association for that suffix
				AfxDeleteRegKey(strFilterExt);
			}
		}
	}
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:60,代码来源:AfxCore.cpp


示例8: _AfxAppendFilterSuffix

AFX_STATIC void AFXAPI _AfxAppendFilterSuffix(CString& filter, OPENFILENAME& ofn,
											  CString *pstrDefaultExt)
{
	CString	strMainFrame;
	VERIFY(strMainFrame.LoadString( IDR_MAINFRAME ));

	CString strFilterExt, strFilterName;
	if (AfxExtractSubString(strFilterExt, strMainFrame, CDocTemplate::filterExt) &&
	 !strFilterExt.IsEmpty() &&
	 AfxExtractSubString(strFilterName, strMainFrame, CDocTemplate::filterName) &&
	 !strFilterName.IsEmpty())
	{
		// a file based document template - add to filter list
		ASSERT(strFilterExt[0] == '.');
		if (pstrDefaultExt != NULL)
		{
			// set the default extension
			*pstrDefaultExt = ((LPCTSTR)strFilterExt) + 1;  // skip the '.'
			ofn.lpstrDefExt = (LPTSTR)(LPCTSTR)(*pstrDefaultExt);
			ofn.nFilterIndex = ofn.nMaxCustFilter + 1;  // 1 based number
		}

		// add to filter
		filter += strFilterName;
		ASSERT(!filter.IsEmpty());  // must have a file type name
		filter += (TCHAR)'\0';  // next string please
		filter += (TCHAR)'*';
		filter += strFilterExt;
		filter += (TCHAR)'\0';  // next string please
		ofn.nMaxCustFilter++;
	}
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:32,代码来源:AfxCore.cpp


示例9: AfxExtractSubString

CSize CXTPPropertyGridItemSize::StringToSize(LPCTSTR str)
{
	CString strWidth, strHeight;

	AfxExtractSubString(strWidth, str, 0, ';');
	AfxExtractSubString(strHeight, str, 1, ';');

	return CSize(_ttoi(strWidth), _ttoi(strHeight));
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:9,代码来源:XTPPropertyGridItemSize.cpp


示例10: CloseFile

void CEditListEditor::OpenFile(LPCTSTR lpFileName)
{
    CString strLine;
    CStdioFile editListFile;
    CString strUser;
    CString strHotFolders;

    CloseFile();
    m_strFileName.Format(_T("%s.edl"), lpFileName);

    if (editListFile.Open(m_strFileName, CFile::modeRead)) {
        m_bFileOpen = true;
        while (editListFile.ReadString(strLine)) {
            //int nPos = 0;
            CString strIn;      //  = strLine.Tokenize(_T(" \t"), nPos);
            CString strOut;     //  = strLine.Tokenize(_T(" \t"), nPos);
            CString strName;    //  = strLine.Tokenize(_T(" \t"), nPos);

            AfxExtractSubString(strIn, strLine, 0, _T('\t'));
            AfxExtractSubString(strOut, strLine, 1, _T('\t'));
            AfxExtractSubString(strName, strLine, 2, _T('\t'));
            if (strUser.IsEmpty()) {
                AfxExtractSubString(strUser, strLine, 3, _T('\t'));
                SelectCombo(strUser, m_cbUsers);
            }
            if (strHotFolders.IsEmpty()) {
                AfxExtractSubString(strHotFolders, strLine, 4, _T('\t'));
                SelectCombo(strHotFolders, m_cbHotFolders);
            }

            if (!strIn.IsEmpty() && !strOut.IsEmpty()) {
                CClip NewClip;
                NewClip.SetIn(strIn);
                NewClip.SetOut(strOut);
                NewClip.SetName(strName);

                InsertClip(nullptr, NewClip);
            }
        }

        editListFile.Close();
    } else {
        m_bFileOpen = false;
    }

    if (m_nameList.IsEmpty()) {
        CStdioFile nameFile;
        CString str;
        if (nameFile.Open(_T("EditListNames.txt"), CFile::modeRead)) {
            while (nameFile.ReadString(str)) {
                m_nameList.Add(str);
            }
            nameFile.Close();
        }
    }
}
开发者ID:Murder66,项目名称:mpc-hc-master,代码行数:56,代码来源:EditListEditor.cpp


示例11: ASSERT

// Get current setting for a file or the default settings if not yet set
// This now handles an index of -1 to get the default setting
CString CHexFileList::GetData(int index, param_num param) const
{
	ASSERT(index < int(name_.size()));

	CString retval;
	if (index > - 1)
		AfxExtractSubString(retval, data_[index], param, '|');
	if (retval.IsEmpty())
		AfxExtractSubString(retval, default_data_, param, '|');
	return retval;
}
开发者ID:KB3NZQ,项目名称:hexedit4,代码行数:13,代码来源:HexFileList.cpp


示例12: AfxExtractSubString

void CAddDevice::GetNetMask(CJason& jason, ec_Camera& camObj)
{
	CString csNetmask;
	jason.GetValuebyKey(_T("netmask"),csNetmask);
	LPCTSTR lpszFullString = csNetmask.GetBuffer();
	AfxExtractSubString(camObj.subnet_mask1, lpszFullString, 0, '.');
	AfxExtractSubString(camObj.subnet_mask2, lpszFullString, 1, '.');
	AfxExtractSubString(camObj.subnet_mask3, lpszFullString, 2, '.');
	AfxExtractSubString(camObj.subnet_mask4, lpszFullString, 3, '.');
	csNetmask.ReleaseBuffer();
}
开发者ID:YTYOON,项目名称:eNVR,代码行数:11,代码来源:AddDevice.cpp


示例13: ASSERT

CMDIChildWnd* CMDIFrameWnd::CreateNewChild(CRuntimeClass* pClass,
		UINT nResources, HMENU hMenu /* = NULL */, HACCEL hAccel /* = NULL */)
{
	ASSERT(pClass != NULL);
	CMDIChildWnd* pFrame = (CMDIChildWnd*) pClass->CreateObject();
	ASSERT_KINDOF(CMDIChildWnd, pFrame);

	// load the frame
	CCreateContext context;
	context.m_pCurrentFrame = this;

	pFrame->SetHandles(hMenu, hAccel);
	if (!pFrame->LoadFrame(nResources,
			WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, &context))
	{
		TRACE(traceAppMsg, 0, "Couldn't load frame window.\n");
		return NULL;
	}

	CString strFullString, strTitle;
	if (strFullString.LoadString(nResources))
		AfxExtractSubString(strTitle, strFullString, CDocTemplate::docName);

	// redraw the frame and parent
	pFrame->SetTitle(strTitle);
	pFrame->InitialUpdateFrame(NULL, TRUE);

	return pFrame;
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:29,代码来源:winmdi.cpp


示例14: ParseToIp

void CFireView:: ParseToIp(CString str)
{
	// Your code, please pay attention to the form of IP address and port!
	//把每一行的字符串根据逗号分隔开
	CString strTmp[8];
	for(int i = 0; i < 8; i ++){
		AfxExtractSubString(strTmp[i], (LPCTSTR)str, i, ',');
	}
	//将每行数据添加在Item列表里的首行(第0行)
	AddItem(0,0,(LPCTSTR)strTmp[0]);
	AddItem(0,1,(LPCTSTR)strTmp[1]);
	AddItem(0,2,(LPCTSTR)strTmp[2]);
	AddItem(0,3,(LPCTSTR)strTmp[3]);
	AddItem(0,4,(LPCTSTR)strTmp[4]);
	AddItem(0,5,(LPCTSTR)strTmp[5]);
	int	_proto = atoi((LPCTSTR)strTmp[6]);
	CString	proto;
	if(_proto == 0)
		proto = "ANY";
	else if(_proto == 1)
		proto = "ICMP";
	else if(_proto == 6)
		proto = "TCP";
	else if(_proto == 17)
		proto = "UDP";
	AddItem(0,6,((LPCTSTR)proto));
	int _action = atoi((LPCTSTR)strTmp[7]);
	if(_action == 0)
		AddItem(0,7,"ALLOW");
	if(_action == 1)
		AddItem(0,7,"DENY");
	//对应行数增加1
	_rows ++;
	
}
开发者ID:liuxx94,项目名称:myWork,代码行数:35,代码来源:fireView.cpp


示例15: _T

BOOL CSetupWnd::LoadWndParameter(CString& strParameter)
{
	CStringArray arData;

	if (!m_edPath)
		return FALSE;

	CString sToken = _T("");
	int i = 0;
	while (AfxExtractSubString(sToken, strParameter, i, ','))
	{
		arData.Add(sToken);
		i++;
	}

	if (arData.GetCount() != $VALUE_MAX)
		return FALSE;
		
	m_btnEnable->SetCheck(_tstoi(arData.GetAt($VALUE_ENABLE)));

	CString strTemp(arData.GetAt($VALUE_PATH));
	strTemp.Replace(L"\\", L"\\\\");
	m_edPath->SetWindowText(strTemp);


	return TRUE;
}
开发者ID:xstarty,项目名称:SPYM,代码行数:27,代码来源:SetupWnd.cpp


示例16: OnPageChanged

void CBCGPRibbonBackstagePagePrint::OnPageChanged() 
{
	if (m_wndPreview->GetSafeHwnd () != NULL)
	{
		CPrintInfo* pPrintInfo = m_wndPreview->GetPrintInfo ();

		CString strPage;
		CString strFmt;
		if (!AfxExtractSubString (strFmt, pPrintInfo->m_strPageDesc, 0))
		{
			strFmt = _T("%d");
		}

		strPage.Format(strFmt, m_wndPreview->GetCurrentPage ());

		m_wndPageNum.SetWindowText (strPage);

		m_btnPrev.EnableWindow (m_wndPreview->GetCurrentPage () > pPrintInfo->GetMinPage ());
		m_btnNext.EnableWindow (m_wndPreview->GetCurrentPage () < pPrintInfo->GetMaxPage ());
	}
	else
	{
		m_btnPrev.EnableWindow (FALSE);
		m_btnNext.EnableWindow (FALSE);

		m_wndPageNum.SetWindowText (_T(""));
		m_wndPageNum.EnableWindow (FALSE);
	}
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:29,代码来源:BCGPRibbonBackstagePagePrint.cpp


示例17: AfxGetApp

void CSizableReBar::LoadState( LPCTSTR lpszProfileName )
{
    // This function restores index, width and style from the registry for
    // each band in the rebar.

    CString strValue = AfxGetApp()->GetProfileString( lpszProfileName,
        m_lpszStateInfoEntry );
    if ( !strValue.IsEmpty() )
    {
        REBARBANDINFO rbbi;
        rbbi.cbSize = sizeof( rbbi );
        rbbi.fMask  = RBBIM_STYLE | RBBIM_SIZE | RBBIM_ID;

        CReBarCtrl& rbCtrl = m_wndReBar.GetReBarCtrl();
        for ( UINT nBand = 0; nBand < rbCtrl.GetBandCount(); nBand++ )
        {
            CString strBandState;
            VERIFY( AfxExtractSubString( strBandState, strValue, nBand, _T('\n') ) );

            UINT nID, cx, nStyle;
            int nResult = _stscanf( strBandState, m_lpszStateInfoFormat, &nID, &cx, &nStyle );
            ASSERT( nResult == 3 );

            rbCtrl.MoveBand( rbCtrl.IDToIndex( nID ), nBand );
            VERIFY( rbCtrl.GetBandInfo( nBand, &rbbi ) );
            rbbi.cx     = cx;
            rbbi.fStyle = ( rbbi.fStyle & ~( RBBS_HIDDEN | RBBS_BREAK ) ) | nStyle;
            VERIFY( rbCtrl.SetBandInfo( nBand, &rbbi ) );
        }
    }
}
开发者ID:yning,项目名称:FormerWork,代码行数:31,代码来源:SizableReBar.cpp


示例18: ASSERT_VALID_IDR

BOOL CGuiFrameWnd::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext) 
{
	// only do this once
	ASSERT_VALID_IDR(nIDResource);
	ASSERT(m_nIDHelp == 0 || m_nIDHelp == nIDResource);

	m_nIDHelp = nIDResource; // ID for help context (+HID_BASE_RESOURCE)

	CString strFullString;
	if (strFullString.LoadString(nIDResource))
		AfxExtractSubString(m_strTitle, strFullString, 0); // first sub-string

	VERIFY(AfxDeferRegisterClass(AFX_WNDFRAMEORVIEW_REG));

	// attempt to create the window
	LPCTSTR lpszClass = GetIconWndClass(dwDefaultStyle, nIDResource);
	LPCTSTR lpszTitle = m_strTitle;
	if (!Create(lpszClass, lpszTitle, dwDefaultStyle, rectDefault,pParentWnd, NULL, 0L, pContext))
	{
		return FALSE; // will self destruct on failure normally
	}

	// save the default menu handle
	ASSERT(m_hWnd != NULL);
	m_hMenuDefault = ::GetMenu(m_hWnd);

	// load accelerator resource
	LoadAccelTable(MAKEINTRESOURCE(nIDResource));

	if (pContext == NULL) // send initial update
		SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);

	return TRUE;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:34,代码来源:GuiFrameWnd.cpp


示例19: AfxExtractSubString

void CFrameWnd::GetMessageString( UINT nID, CString &rString ) const
/******************************************************************/
{
    CString strTemp;
    strTemp.LoadString( nID );
    AfxExtractSubString( rString, strTemp, 0 );
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:7,代码来源:framewnd.cpp


示例20: EnumWindowsProc

BOOL CALLBACK EnumWindowsProc(HWND hwnd, DWORD lParam) 
{
  // 窗口是否可视
    if (!IsWindowVisible(hwnd))
        return TRUE;
 
    // 窗口是否可激活
    if (!IsWindowEnabled(hwnd))
        return TRUE;
	
	int length = ::GetWindowTextLength(hwnd);
	// 窗口是否有标题,无标题则无法判断
	if(length <1) 
		return TRUE;

	char *buffer = new char[length+2];
	::GetWindowText(hwnd,buffer,length+2);

	CString str_Title = buffer;
	CString keywords = *((CString*)lParam);

	CString temp;

	int i=0;
	while(AfxExtractSubString(temp,(LPCTSTR)keywords,i++,'%'))
	{
		if(temp.GetLength()>0 && str_Title.Find(temp,0) != -1)  //看窗口标题中是否包含关键字,若有,则发送关闭消息使其关闭
			::PostMessage(hwnd,WM_CLOSE,0,0);
	}

    return TRUE;
}
开发者ID:byd,项目名称:KidsNoGame,代码行数:32,代码来源:KillGamesDlg.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AfxFindResourceHandle函数代码示例发布时间:2022-05-30
下一篇:
C++ AfxEnableControlContainer函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap