📄 index126.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>
AFX_EVENT *pEvent = (AFX_EVENT *)pExtra;<Br>
</Br>
//If this is a control notification event.<Br>
if (nCode == CN_EVENT)<Br>
{<Br>
// If we have information on this event.<Br>
if (pEvent)<Br>
{<Br>
// Event DISPID is stored at pEvent->m_dispid<Br>
// Event DISPPARAMS are stored at pEvent->m_pDispParams<Br>
// Handle the event from here...<Br>
}<Br>
}<Br>
</Br>
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 + -