⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index126.htm

📁 一本不错的VC编程的参考书
💻 HTM
字号:
<html>
<style type="text/css"><!--
.p9 {  font-family: "宋体"; font-size: 9pt}a        {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color: #FF0000;}
--></style>
<body background="../di2001.jpg">
<h3 align="center"><font COLOR="#AOAO99"></font></h3>
<table width="100%" border="1" cellspacing="1">
<tr><td><p align="center"><font color="#FF0000">如何增加视图中ActiveX控件的事件处理函数?</font></td></tr>
<tr><td><p>
</Br>
如果我在对话框中加入微软的网络浏览器,很容易通过类模板加入对事件的处理.但我现在在视图中用m_pBrowser=new CWebBrowser2加入了网络浏览器,我该如何对事件进行处理?<Br>
</Br>
到www.vcdj.com(inet章节)去看看,有一篇文章名为"Building a Webbrowser in a Afternoon".如下的代码也可能是你所需要的:<Br>
</Br>
#include  // For AFX_EVENT def.<Br>
</Br>
BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)<Br>
{<Br>
&nbsp;&nbsp;&nbsp;&nbsp;AFX_EVENT *pEvent = (AFX_EVENT *)pExtra;<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;//If this is a control notification event.<Br>
&nbsp;&nbsp;&nbsp;&nbsp;if (nCode == CN_EVENT)<Br>
&nbsp;&nbsp;&nbsp;&nbsp;{<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// If we have information on this event.<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pEvent)<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Event DISPID is stored at pEvent->m_dispid<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Event DISPPARAMS are stored at pEvent->m_pDispParams<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Handle the event from here...<Br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<Br>
&nbsp;&nbsp;&nbsp;&nbsp;}<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;return CWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);<Br>
}<Br>
</Br>
</Br>
</Br>
</Br>
</p></td></tr>
</table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -