<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MouseWheel event handler in Map CoClass in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500779#M13451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apologies in advance if I'm missing something really obvious, but I haven't spotted the answer to this in the ArcObjects Library Reference yet ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt;&lt;SPAN&gt; I'm maintaining a C++ map display application that makes use of ArcGIS components, version 9.3.1 SP1.&amp;nbsp; It instantiates a Map object (esriCarto::Map), queries for the IActiveView interface, and calls Activate to pass in the view window client area (and a whole bunch of other properties are also set via various interfaces).&amp;nbsp; It is then used in the middle of a sequence of drawing operations to render the final display image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;SPAN&gt; The WM_MOUSEWHEEL event seems to be picked up in the Map object (or a child object?), and is causing odd behaviour.&amp;nbsp; What's supposed to happen is that the view window receives this message, then calls a 'zoom' method to trigger appropriate redrawing.&amp;nbsp; What actually happens is that the message passes through the view window's PreTranslateMessage, then the display area glitches, THEN then view window's OnMouseWheel handler is called to handle the zoom.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By 'glitches', I mean the view window turns white briefly, then the previous image is redisplayed. This did not happen in a previous version of the app that integrated with ArcGIS 9.2, and none of the app's own drawing code is being called while this glitching effect is happening.&amp;nbsp; It also doesn't happen if the window's zoom function is called via an alternative context menu option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Having read around the reference info for a while, I suspect that the Map's ScreenDisplay object is responding to the mouse wheel event and doing something we don't want it to do to the view area - I also suspect there's a way of telling it not to, but I can't seem to find it.&amp;nbsp; I do have a workaround, i.e. to handle the zoom in the view window's PreTranslateMessage, and prevent the message going any further, but that feels like a bit of a hack.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, can any kind and clever person please point me at a way of telling the Map object to ignore mouse wheel events?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 May 2010 10:40:29 GMT</pubDate>
    <dc:creator>DaveO_Neill</dc:creator>
    <dc:date>2010-05-18T10:40:29Z</dc:date>
    <item>
      <title>MouseWheel event handler in Map CoClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500779#M13451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apologies in advance if I'm missing something really obvious, but I haven't spotted the answer to this in the ArcObjects Library Reference yet ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt;&lt;SPAN&gt; I'm maintaining a C++ map display application that makes use of ArcGIS components, version 9.3.1 SP1.&amp;nbsp; It instantiates a Map object (esriCarto::Map), queries for the IActiveView interface, and calls Activate to pass in the view window client area (and a whole bunch of other properties are also set via various interfaces).&amp;nbsp; It is then used in the middle of a sequence of drawing operations to render the final display image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;SPAN&gt; The WM_MOUSEWHEEL event seems to be picked up in the Map object (or a child object?), and is causing odd behaviour.&amp;nbsp; What's supposed to happen is that the view window receives this message, then calls a 'zoom' method to trigger appropriate redrawing.&amp;nbsp; What actually happens is that the message passes through the view window's PreTranslateMessage, then the display area glitches, THEN then view window's OnMouseWheel handler is called to handle the zoom.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By 'glitches', I mean the view window turns white briefly, then the previous image is redisplayed. This did not happen in a previous version of the app that integrated with ArcGIS 9.2, and none of the app's own drawing code is being called while this glitching effect is happening.&amp;nbsp; It also doesn't happen if the window's zoom function is called via an alternative context menu option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Having read around the reference info for a while, I suspect that the Map's ScreenDisplay object is responding to the mouse wheel event and doing something we don't want it to do to the view area - I also suspect there's a way of telling it not to, but I can't seem to find it.&amp;nbsp; I do have a workaround, i.e. to handle the zoom in the view window's PreTranslateMessage, and prevent the message going any further, but that feels like a bit of a hack.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, can any kind and clever person please point me at a way of telling the Map object to ignore mouse wheel events?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 10:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500779#M13451</guid>
      <dc:creator>DaveO_Neill</dc:creator>
      <dc:date>2010-05-18T10:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: MouseWheel event handler in Map CoClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500780#M13452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I also suspect there's a way of telling it not to, but I can't seem to find it&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd try using Spy++ to figure out what window is blocking the WM_MOUSEWHEEL message then subclassing that window to block the message.&amp;nbsp; (I suspect it will be the ScreenDisplay's hWnd).&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://support.microsoft.com/kb/815775"&gt;http://support.microsoft.com/kb/815775&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you receive the message you may want to call IScreenDisplayZoom methods.&amp;nbsp; I thought this is what the map does by default anyway, but maybe not.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 12:41:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500780#M13452</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-05-18T12:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: MouseWheel event handler in Map CoClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500781#M13453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kirk, although that also sounds like a bit of a fudge.&amp;nbsp; If I need to code a workaround, I think the PreTranslateMessage option is the simplest solution, since the app's view window doesn't care about the mouse wheel other than for zooming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there no existing way of calling into the object to change it's behaviour, to make it ignore the mouse wheel?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 13:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500781#M13453</guid>
      <dc:creator>DaveO_Neill</dc:creator>
      <dc:date>2010-05-18T13:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: MouseWheel event handler in Map CoClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500782#M13454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure, might be worth trying these (or combinations thereof):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IViewManager.DelayBackgroundDraw = true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IViewRefresh.ProgressiveDrawing = true&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 13:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500782#M13454</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-05-18T13:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: MouseWheel event handler in Map CoClass</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500783#M13455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, but neither of those options (or combinations) seem to have the desired effect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh well, I guess I'm stuck with using a workaround!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the replies.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 08:23:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousewheel-event-handler-in-map-coclass/m-p/500783#M13455</guid>
      <dc:creator>DaveO_Neill</dc:creator>
      <dc:date>2010-05-19T08:23:22Z</dc:date>
    </item>
  </channel>
</rss>

