Login dark
title: 在WebBrowser控件打开的网页链接后直接打开而不新弹出IE窗口来打开解决方法
author: Love02xp
date: 2020-03-13 10:13:23
category: [电脑网络]
tags: [代码,VC6]

<!--more-->

# include < afxinet.h >

void CSameIEWndDlg::OnStatusTextChangeExplorer1(LPCTSTR Text)
{
DWORD dwServiceType=AFX_INET_SERVICE_HTTP;
CString strServer;
CString strObject;
INTERNET_PORT nPort;

if (::AfxParseURL(Text,dwServiceType,strServer,strObject,nPort))
{
m_strUrl=Text;
}
}

void CSameIEWndDlg::OnNewWindow2Explorer1(LPDISPATCH FAR ppDisp, BOOL FAR Cancel)
{
m_wndWebBrowser.Navigate(m_strUrl,NULL,NULL,NULL,NULL);
*Cancel=TRUE;
}