Click here to Skip to main content
15,908,254 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: how to implement MMC Context menu Pin
Jonathan [Darka]26-Oct-07 0:24
professionalJonathan [Darka]26-Oct-07 0:24 
Questionhow to implement MMC Context menu Pin
Thanks for all the fish24-Oct-07 19:59
Thanks for all the fish24-Oct-07 19:59 
AnswerRe: how to implement MMC Context menu Pin
led mike25-Oct-07 4:35
led mike25-Oct-07 4:35 
Questionplz Help!! hide MMC contextmenu Item Pin
Thanks for all the fish23-Oct-07 2:33
Thanks for all the fish23-Oct-07 2:33 
AnswerRe: plz Help!! hide MMC contextmenu Item Pin
ritz123423-Oct-07 18:40
ritz123423-Oct-07 18:40 
GeneralRe: plz Help!! hide MMC contextmenu Item [modified] Pin
Thanks for all the fish23-Oct-07 21:47
Thanks for all the fish23-Oct-07 21:47 
QuestionHow to monitor ie events via toolbar without mfc Pin
shivditya22-Oct-07 20:20
shivditya22-Oct-07 20:20 
AnswerRe: How to monitor ie events via toolbar without mfc Pin
Stuart Dootson24-Oct-07 2:51
professionalStuart Dootson24-Oct-07 2:51 
To handle those events in ATL, you need to derive a class from IDispEventImpl and add a sink map handling the events you want. Here's some incomplete code that handles mouse over and mouse out events from a browser window embedded as a control:

class MyView : public CWindowImpl<<small>My</small>View, CAxWindow>,
               public IDispEventImpl<1, MyView, &DIID_HTMLElementEvents2, &LIBID_MSHTML, 4, 0>
{
public:
   typedef IDispEventImpl<1, MyView, &DIID_HTMLElementEvents2, &LIBID_MSHTML, 4, 0> HTMLElementEventsSink;

   BEGIN_SINK_MAP(MyView)
      SINK_ENTRY_EX(1, DIID_HTMLElementEvents2, DISPID_HTMLELEMENTEVENTS_ONMOUSEOVER, OnMouseOver)
      SINK_ENTRY_EX(1, DIID_HTMLElementEvents2, DISPID_HTMLELEMENTEVENTS_ONMOUSEOUT, OnMouseOut)
   END_SINK_MAP()

   BEGIN_MSG_MAP_EX(MyView)
      MESSAGE_HANDLER(WM_CREATE, OnCreate)
      MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
   END_MSG_MAP()
private:
</code><code>   void __stdcall OnMouseOver(IHTMLEventObj* pEvent);
   void __stdcall OnMouseOut(IHTMLEventObj* pEvent);
</code>
<code>   LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
   {
      /* set up the browser window and document */
      if (SUCCEEDED(QueryControl(&pWB2_)) &&
          SUCCEEDED(pWB2_->get_Document(&doc_)) &&
          </code><code>SUCCEEDED(</code><code>doc_->get_documentElement(&docElem_)))
      {
         HTMLElementEventsSink::DispEventAdvise(docElem_);
      }
   }
   LRESULT OnDestroy(UINT msg, WPARAM wParam, LPARAM lParam, BOOL &)
   {
      if (docElem_)
      {
         HTMLElementEventsSink::DispEventUnadvise(docElem_);
         docElem_.Release();
      }
   }
   CComPtr<IWebBrowser2> pWB2_;
   CComQIPtr<IHTMLDocument3> doc_;
   CComPtr<IHTMLElement> docElem_;
};


You'll need to call HTMLElementEventsSink::DispEventAdvise to tell IE that you want to handle the events, using an appropriate IDispatch pointer to say which objects events you want.



QuestionProblems using a chevron for a deskband Pin
Vikhyat Karumanchi22-Oct-07 9:53
Vikhyat Karumanchi22-Oct-07 9:53 
QuestionCOM Using IPicture Interface Pin
Ju@ncho22-Oct-07 8:37
Ju@ncho22-Oct-07 8:37 
AnswerRe: COM Using IPicture Interface Pin
Nathan Holt at EMOM23-Oct-07 7:37
Nathan Holt at EMOM23-Oct-07 7:37 
Questionplz help How to get MMC result view Item index and subitem values(string) [modified] Pin
Thanks for all the fish21-Oct-07 20:06
Thanks for all the fish21-Oct-07 20:06 
AnswerRe: URGENT!!! How to get MMC result view Item index and subitem values(string) Pin
Jonathan [Darka]22-Oct-07 1:07
professionalJonathan [Darka]22-Oct-07 1:07 
QuestionAdding Connection Points support Pin
filippov.anton17-Oct-07 22:05
filippov.anton17-Oct-07 22:05 
AnswerRe: Adding Connection Points support Pin
Ju@ncho7-Nov-07 6:08
Ju@ncho7-Nov-07 6:08 
QuestionCOM interfaces with ATL Pin
DanyCode17-Oct-07 9:38
DanyCode17-Oct-07 9:38 
AnswerRe: COM interfaces with ATL Pin
Ju@ncho22-Oct-07 8:28
Ju@ncho22-Oct-07 8:28 
QuestionAdding Images to the subitems in ListView Pin
D.Srihari16-Oct-07 1:36
D.Srihari16-Oct-07 1:36 
AnswerRe: Adding Images to the subitems in ListView Pin
Stuart Dootson16-Oct-07 2:09
professionalStuart Dootson16-Oct-07 2:09 
AnswerRe: Adding Images to the subitems in ListView Pin
Michael Dunn16-Oct-07 7:37
sitebuilderMichael Dunn16-Oct-07 7:37 
Questionconvert the string into german currency Pin
dews turner14-Oct-07 20:41
dews turner14-Oct-07 20:41 
AnswerRe: convert the string into german currency Pin
Stuart Dootson15-Oct-07 0:55
professionalStuart Dootson15-Oct-07 0:55 
QuestionSTL map constructor -- 3rd and 4th argument... Pin
devvvy13-Oct-07 17:02
devvvy13-Oct-07 17:02 
AnswerRe: STL map constructor -- 3rd and 4th argument... Pin
Stephen Hewitt14-Oct-07 15:59
Stephen Hewitt14-Oct-07 15:59 
AnswerRe: STL map constructor -- 3rd and 4th argument... Pin
Stuart Dootson14-Oct-07 20:53
professionalStuart Dootson14-Oct-07 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.