How stop click event on CHtmlView drived class?

81 Views Asked by At

In SDI application on right pain view on a FormView I am showing HTML preview using ChtmlView Navigate function. When I open doc/docx file in HTML preview then it was editable. I want to prevent click event so no one can edit this.

How can I stop click event on CHtmlView drived class ?

I try

BOOL CHtmlPreview::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONUP || pMsg->message == WM_LBUTTONDBLCLK)
{pMsg->message =    0;pMsg->wParam  =   0;  pMsg->lParam  = 0;}
}

But when I click on previewed file (doc/docx ) in Chtmlview container then it is not handle by CHtmlPreview::PreTranslateMessage(MSG* pMsg) and not its parent CFormView drived class PreTranslateMessage(MSG* pMsg). Control not goes to these function.

My problem is like:
CHtmlView class and focus

I also try to overrides CHtmlView::OnTranslateAccelerator but this is not available in my CHtmlPreview class whose base class is ChtmlView.

Thanks

0

There are 0 best solutions below