이 기능만 단위테스트(??)하면 이상없는데 이 소스를 메인소스에 붙이면
동작하지 않네요..쩝..
http://groups.google.co.kr/group/borland.public.cppbuilder.internet/browse_thread/thread/5f96ec0062bab92a/2a76492cfdebd1a0?lnk=st&q=CppWebBrowser++key&rnum=12&hl=ko#2a76492cfdebd1a0
여기 참조하시면 될겁니다..
메인에 머지하면 저는 안되니... 흐.. 머리아픕니다.. -.- 즐프....
In the Header file include in the private section the declaration:
----------------------------------------------------------------------------
-----
void __fastcall OwnMessageHandler(tagMSG &Msg, bool &Handled);
IOleInPlaceActiveObject *OleInPlaceActiveObject;
The messagehandler must be connected:
-----------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
// Installation of an own Messagehandler to catch right mouse button
events
// and to adjust problems with key input in TWebBrowser
Application->OnMessage = OwnMessageHandler;
}
and now the Messagehandler itself:
--------------------------------------------------
void __fastcall TForm1::OwnMessageHandler(tagMSG &Msg, bool &Handled)
{
if (Msg.message == WM_RBUTTONDOWN || Msg.message == WM_RBUTTONDBLCLK)
Handled = true;
else if (CppWebBrowser1 && (Msg.message == WM_KEYDOWN || Msg.message ==
WM_KEYUP) &&
(Msg.wParam == VK_RETURN || Msg.wParam == VK_EXECUTE) )
{
Handled = IsDialogMessage(CppWebBrowser1->Handle, &Msg);
if (Handled)
{
if (!OleInPlaceActiveObject)
CppWebBrowser1->Application->QueryInterface(IID_IOleInPlaceActiveObject,
(void **)&OleInPlaceActiveObject);
if (OleInPlaceActiveObject)
OleInPlaceActiveObject->TranslateAccelerator(&Msg);
}
}
else
Handled = false;
}