对话框中,其他地方都能响应OnContextMenu操作,但是在Picuture控件中我加入下面代码,就获取不到OnContextMenu操作,我想可能是被新创建的NCTVideoView.VideoView.1控件先接收了右键消息。现在如何解决这个问题。让它响应OnContextMenu操作。
CRect rect;
GetDlgItem(IDC_Frame)->GetWindowRect(&rect);
ScreenToClient(rect);
if(m_pWnd->CreateControl("NCTVideoView.VideoView.1", 0, WS_CHILD | WS_VISIBLE, rect, this, IDC_VideoView))
{
// retrieve the main interface
pVideoView = m_pWnd->GetControlUnknown();
}
else
{
AfxMessageBox("Can't create NCTVideoView control");
exit(1);
}
CRect rect;
GetDlgItem(IDC_Frame)->GetWindowRect(&rect);
ScreenToClient(rect);
if(m_pWnd->CreateControl("NCTVideoView.VideoView.1", 0, WS_CHILD | WS_VISIBLE, rect, this, IDC_VideoView))
{
// retrieve the main interface
pVideoView = m_pWnd->GetControlUnknown();
}
else
{
AfxMessageBox("Can't create NCTVideoView control");
exit(1);
}
然后使用OnContextMenu,但是在这在该Picture控件中,响应的point只是视图中的左上角原始位置。