오후 8:42 2002-03-19
조경민 bro@shinbiro.com
마우스 위치에 있는 엘리먼트 얻어오기
=================================================================
if (SUCCEEDED(hr))
{
IHTMLEventObj* pEvtObj;
hr = pParentWindow->get_event(&pEvtObj);
pParentWindow->Release();
if (SUCCEEDED(hr))
{
long clientX = 0L, clientY = 0L;
pEvtObj->get_clientX(&clientX);
pEvtObj->get_clientY(&clientY);
pEvtObj->Release();
IHTMLElement* pHTMLElement = NULL;
hr = pDocument->elementFromPoint(clientX, clientY, &pHTMLElement);
....
...
}
클릭했을때 이벤트 얻기
You may also have to include an entry in the dispatch map: (CHtmlEditView is
a class I have derived from CHtmlView )
BEGIN_DISPATCH_MAP(CHtmlEditView, CCmdTarget)
DISP_FUNCTION_ID(CHtmlEditView, "onclick",
DISPID_HTMLDOCUMENTEVENTS_ONCLICK,
OnClick, VT_BOOL, VTS_NONE)
END_DISPATCH_MAP()
VARIANT_BOOL CHtmlEditView::OnClick()
{
MSHTML::IHTMLWindow2Ptr spWin2;
MSHTML::IHTMLEventObjPtr spEventObj;
MSHTML::IHTMLElementPtr spEle;
MSHTML::IHTMLDocument2Ptr spDoc2 = NULL;
m_pBrowserApp->get_Document( (IDispatch**)&spDoc2 );
spWin2 = m_spDoc2->GetparentWindow();
spEventObj = spWin2->Getevent();
spEle = spEventObj->GetsrcElement(); // returns the element "clicked"
on
return VARIANT_TRUE;
}
조경민 bro@shinbiro.com
마우스 위치에 있는 엘리먼트 얻어오기
=================================================================
if (SUCCEEDED(hr))
{
IHTMLEventObj* pEvtObj;
hr = pParentWindow->get_event(&pEvtObj);
pParentWindow->Release();
if (SUCCEEDED(hr))
{
long clientX = 0L, clientY = 0L;
pEvtObj->get_clientX(&clientX);
pEvtObj->get_clientY(&clientY);
pEvtObj->Release();
IHTMLElement* pHTMLElement = NULL;
hr = pDocument->elementFromPoint(clientX, clientY, &pHTMLElement);
....
...
}
클릭했을때 이벤트 얻기
You may also have to include an entry in the dispatch map: (CHtmlEditView is
a class I have derived from CHtmlView )
BEGIN_DISPATCH_MAP(CHtmlEditView, CCmdTarget)
DISP_FUNCTION_ID(CHtmlEditView, "onclick",
DISPID_HTMLDOCUMENTEVENTS_ONCLICK,
OnClick, VT_BOOL, VTS_NONE)
END_DISPATCH_MAP()
VARIANT_BOOL CHtmlEditView::OnClick()
{
MSHTML::IHTMLWindow2Ptr spWin2;
MSHTML::IHTMLEventObjPtr spEventObj;
MSHTML::IHTMLElementPtr spEle;
MSHTML::IHTMLDocument2Ptr spDoc2 = NULL;
m_pBrowserApp->get_Document( (IDispatch**)&spDoc2 );
spWin2 = m_spDoc2->GetparentWindow();
spEventObj = spWin2->Getevent();
spEle = spEventObj->GetsrcElement(); // returns the element "clicked"
on
return VARIANT_TRUE;
}
'KB > MFC/Win32' 카테고리의 다른 글
[MSDN] 네트워크성능향상.doc (0) | 2004.04.28 |
---|---|
MFC정규DLL안의 dlg에서 엑티브엑스컨트롤쓸때 (0) | 2004.04.28 |
HICON을 ico로 저장 (0) | 2004.04.28 |
확장자로 실행파일 찾기 (0) | 2004.04.28 |
[DB] 트리거 사용 (0) | 2004.04.28 |