<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Ribbonbar Systembutton</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Ribbonbar Systembutton]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 22:38:23 +0000</pubDate>
  <lastBuildDate>Thu, 24 Jul 2008 15:55:31 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=11566</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Ribbonbar Systembutton : I should add, make sure to call...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38865&amp;title=ribbonbar-systembutton#38865</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 11566<br /><strong>Posted:</strong> 24 July 2008 at 3:55pm<br /><br />I should add, make sure to call Set mobjSysBtn = RibbonBar.AddSystemButton() (or equivalent) to assign the SystemButton to the object reference.<br>]]>
   </description>
   <pubDate>Thu, 24 Jul 2008 15:55:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38865&amp;title=ribbonbar-systembutton#38865</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbonbar Systembutton : I&amp;#039;m not sure if there&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38864&amp;title=ribbonbar-systembutton#38864</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 11566<br /><strong>Posted:</strong> 24 July 2008 at 3:52pm<br /><br />I'm not sure if there's an easier way (I'd like to know if there is), but using the QueryUnload event as Baldur suggests doesn't differentiate between double-clicking the system button and clicking the X button. You can test for the position of the mouse cursor and make sure it is not in the SystemButton area though, so something like this works:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private mobjSysBtn As CommandBarPopup<br><br>Private Type POINTAPI<br>&nbsp;&nbsp; x As Long<br>&nbsp;&nbsp; y As Long<br>End Type<br><br>Private Type RECT<br>&nbsp;&nbsp;&nbsp; Left As Long<br>&nbsp;&nbsp;&nbsp; Top As Long<br>&nbsp;&nbsp;&nbsp; Right As Long<br>&nbsp;&nbsp;&nbsp; Bottom As Long<br>End Type<br><br>Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long<br>Private Declare Function ScreenToClient Lib "user32.dll" (ByVal hwnd As Long, ByRef lpPoint As POINTAPI) As Long<br>Private Declare Function PtInRect Lib "user32.dll" (ByRef lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long<br><br>Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)<br>&nbsp;&nbsp; Dim udtPoint As POINTAPI<br>&nbsp;&nbsp; Dim udtRect As RECT<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; With udtRect<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mobjSysBtn.GetRect .Left, .Top, .Right, .Bottom&nbsp;&nbsp; ' Get the position of the SystemButton<br>&nbsp;&nbsp; End With<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; If UnloadMode = vbFormControlMenu Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetCursorPos udtPoint&nbsp;&nbsp;&nbsp; ' Get the position of the mouse pointer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ScreenToClient Me.hwnd, udtPoint&nbsp;&nbsp;&nbsp; ' Convert screen coordinates to coordinates relative to the form with the SystemButton<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cancel = PtInRect(udtRect, udtPoint.x, udtPoint.y)&nbsp;&nbsp;&nbsp; ' Only cancel unloading if the mouse pointer is not above the SystemButton<br>&nbsp;&nbsp; End If<br>End Sub<br></pre></td></tr></table><br><br>A potential problem with this approach is that the program won't close if the pointer is above the SystemButton and the user press Ctrl+F4 (probably a rare circumstance, but definitely a limitation of this approach...I suppose you could perform a check to see if the Ctrl key is down and if so ignore the pointer position).<br><br>I'd be happy to be shown an easier way to do this. The only other way I know is to subclass the system button and consume WM_LBUTTONDBLCLK (complicated, but I have an example if you are interested).<br>]]>
   </description>
   <pubDate>Thu, 24 Jul 2008 15:52:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38864&amp;title=ribbonbar-systembutton#38864</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbonbar Systembutton : In VB6 use Form_QueryUnload-Event....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38862&amp;title=ribbonbar-systembutton#38862</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2531">Baldur</a><br /><strong>Subject:</strong> 11566<br /><strong>Posted:</strong> 24 July 2008 at 2:31pm<br /><br /><P>In VB6 use Form_QueryUnload-Event.</P>]]>
   </description>
   <pubDate>Thu, 24 Jul 2008 14:31:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38862&amp;title=ribbonbar-systembutton#38862</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbonbar Systembutton : Hi,  Is there a way to disable...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38848&amp;title=ribbonbar-systembutton#38848</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4166">JvdH</a><br /><strong>Subject:</strong> 11566<br /><strong>Posted:</strong> 24 July 2008 at 9:50am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Is there a way to disable that the app closes when doubleclick on the system button, I cannot find a way to disable that.</DIV><DIV>&nbsp;</DIV><DIV>Thank you :)</DIV>]]>
   </description>
   <pubDate>Thu, 24 Jul 2008 09:50:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11566&amp;PID=38848&amp;title=ribbonbar-systembutton#38848</guid>
  </item> 
 </channel>
</rss>