<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Getting Started</title><link>http://forums.silverlight.net/forums/14.aspx</link><description>The perfect forum for asking the basic questions. No question too simple!</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/288664.aspx</link><pubDate>Wed, 16 Sep 2009 22:57:40 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:288664</guid><dc:creator>SharpGIS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/288664.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=288664</wfw:commentRss><description>&lt;p&gt;I think the keyword in your question is :&amp;quot;Hack&amp;quot;.&lt;/p&gt;
&lt;p&gt;In other words, don&amp;#39;t even bother trying to do this. It&amp;#39;s a poor approach to circumvent the default right click menu. Instead try and think of other gestures you could use.&lt;/p&gt;</description></item><item><title>Re: Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/288368.aspx</link><pubDate>Wed, 16 Sep 2009 13:46:52 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:288368</guid><dc:creator>Harish L</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/288368.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=288368</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Morten,&lt;/p&gt;&lt;p&gt;Do you know any similar hack for chrome?&amp;nbsp; &lt;/p&gt;&lt;p&gt;Best,&lt;/p&gt;&lt;p&gt;Harish. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/228757.aspx</link><pubDate>Thu, 04 Jun 2009 01:35:02 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:228757</guid><dc:creator>goldenbull</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/228757.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=228757</wfw:commentRss><description>Thanks for your help! As far as now, my app need not heavy animations, with these hacks, silverlight works fine for me.</description></item><item><title>Re: Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/228573.aspx</link><pubDate>Wed, 03 Jun 2009 18:12:54 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:228573</guid><dc:creator>SharpGIS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/228573.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=228573</wfw:commentRss><description>&lt;p&gt;There are several reason why Silverlight doesn&amp;#39;t give you a right click option, but none of them are because it wasn&amp;#39;t possible for Microsoft to do, but it was made like this by choice. Also remember that some systems don&amp;#39;t have right click.&lt;/p&gt;&lt;p&gt;The fact of the matter is that this is how Silverlight currently works and you will have to live with it. Yes there are hacks you can do, but they are and always will be hacks, and the nature of these hacks requires the browser to render the control to be able to intercept rightclick before the silverlight plugin handles it.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;xbap is a whole different story and doesn&amp;#39;t compare to Silverlight. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/228448.aspx</link><pubDate>Wed, 03 Jun 2009 12:57:49 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:228448</guid><dc:creator>goldenbull</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/228448.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=228448</wfw:commentRss><description>&lt;p&gt;Thanks for your reply, but my customers can not live without right mouse...&lt;/p&gt;
&lt;p&gt;I have some more questions. I know that IE and Firefox can run xbap application, in which right click is just as simple as windows application. Why Silverlight doesn&amp;#39;t use similar approach?&lt;/p&gt;
&lt;p&gt;And why should the browser deal with rendering jobs when it deal with the right click event? I think they are two different things. Just suppose:&lt;/p&gt;
&lt;p&gt;1. Browser gets the right click event&lt;/p&gt;
&lt;p&gt;2. Browser knows the right click is on silverlight plugin, including the position information&lt;/p&gt;
&lt;p&gt;3. Browser fire a right click event to the plugin, and do nothing more. The plugin renders itself in window mode.
&lt;p&gt;Is this possible?&lt;/p&gt;</description></item><item><title>Re: Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/228299.aspx</link><pubDate>Wed, 03 Jun 2009 06:49:22 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:228299</guid><dc:creator>SharpGIS</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/228299.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=228299</wfw:commentRss><description>The reason that it must be in windowless mode is that we rely on the browser for the right click event, and for the browser to receive the rightclick, the browser should take care of rendering the plugin.&lt;br /&gt;
I recently wrote a blogpost that went a little deeper with mouse gestures and rightclick, and also works with mozilla browsers: http://www.sharpgis.net/post/2009/05/09/Adding-rightclick-to-Silverlight.aspx&lt;br /&gt;&lt;br /&gt;
Having said that, no matter how you do this, it is a hack, and I think you should try and think outside the box and not use right click (my blog post was initially about mouse gestures that would function as alternative to right click). What I&amp;#39;m getting at is that the right click menu is there for the user, and we shouldn&amp;#39;t be telling the user what they can or cant do. The equivalient in Windows would be if you create a windows application and you take over the start key for something other than opening the start menu.</description></item><item><title>Dig deeper into right-mouse-click/oncontextmenu/windowless</title><link>http://forums.silverlight.net/forums/thread/228270.aspx</link><pubDate>Wed, 03 Jun 2009 05:23:42 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:228270</guid><dc:creator>goldenbull</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/228270.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=14&amp;PostID=228270</wfw:commentRss><description>&lt;p&gt;In Silverlight 2.0, it&amp;#39;s quite easy to hide the default context menu when user right click in Silverlight app:&lt;/p&gt;
&lt;p&gt;1. Set Windowless attribute to true in html or aspx&lt;/p&gt;
&lt;p&gt;2. In C# code, add a line: HtmlPage.Document.AttachEvent(&amp;quot;oncontextmenu&amp;quot;, myHandler);&lt;/p&gt;
&lt;p&gt;3. Implement myHandler to deal with right click event.&lt;/p&gt;

&lt;p&gt;For details, please check these links:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://silverlight.net/forums/p/48157/127981.aspx"&gt;http://silverlight.net/forums/p/48157/127981.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://silverlight.net/blogs/msnow/archive/2008/07/01/tip-of-the-day-14-how-to-right-click-on-a-silverlight-application.aspx"&gt;http://silverlight.net/blogs/msnow/archive/2008/07/01/tip-of-the-day-14-how-to-right-click-on-a-silverlight-application.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I want to dig deeper to make the whole thing more clear. My question is why the Silverlight app must in Windowless mode in order to prevent the default contextmenu?&lt;/p&gt;
&lt;p&gt;I try to list &amp;quot;what happened&amp;quot; one by one:&lt;/p&gt;
&lt;p&gt;1. user right click the mouse, and the browser gets the action through WM_RBUTTONDOWN (suppose we are on Windows OS, the browser must be a windows application.)&lt;/p&gt;
&lt;p&gt;2. browser will invoke oncontextmenu handler? well, I don&amp;#39;t know the detail here, but I guess this is the crucial step of my question.&lt;/p&gt;
&lt;p&gt;3. the managed code myHandler method will be invoked&lt;/p&gt;
&lt;p&gt;4. e.PreventDefault() will invoke DOM_PreventDefault(IntPtr pBrowserService, IntPtr pObject) in agcore.dll&lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;Great thanks to anybody helping me expand and complete the step 2&lt;/p&gt;</description></item></channel></rss>