<?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 : How to set transparent when window is inactive???</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : How to set transparent when window is inactive???]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 14:52:08 +0000</pubDate>
  <lastBuildDate>Fri, 29 Jan 2010 19:31:15 +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=16086</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[How to set transparent when window is inactive??? : Well, I&amp;#039;ve actually found...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56476&amp;title=how-to-set-transparent-when-window-is-inactive#56476</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4108">shipwreck</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 7:31pm<br /><br />Well, I've actually found a way to do it when the mouse leaves the window and I consider it to be more functional either way at this moment. Thanks for the advice guys, I'll close this one for now. :&#093;]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 19:31:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56476&amp;title=how-to-set-transparent-when-window-is-inactive#56476</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : You need to subclass VB6 forms...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56464&amp;title=how-to-set-transparent-when-window-is-inactive#56464</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 1:47pm<br /><br />You need to subclass VB6 forms to catch activation/deactivation from/to different applications. The Form_Activate/Deactivate events only work for forms in your own app.<br><br>See the AppGotFocus and AppLostFocus events in the code in this thread:<br><a href="http://forum.codejock.com/forum_posts.asp?TID=13008&amp;PID=43883#43883" target="_blank">http://forum.codejock.com/forum_posts.asp?TID=13008&amp;PID=43883#43883</a><br>]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 13:47:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56464&amp;title=how-to-set-transparent-when-window-is-inactive#56464</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Mr.Den, that&amp;#039;s great code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56463&amp;title=how-to-set-transparent-when-window-is-inactive#56463</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4108">shipwreck</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 1:10pm<br /><br />Mr.Den, that's great code but I prefer to use the transparency feature built into the Form Extender control.<br /><br />Aaron, your sample works great. But I found out why it wasn't working for me. You see, your sample launches multiple forms and then makes the inactive forms transparent. My idea was to basically have one form, and when the user selects another window to be active, it would then turn transparent as well. Your sample does this but only with the forms you have created rather than all forms the user may be using. Would you know how to do it this way as well?]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 13:10:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56463&amp;title=how-to-set-transparent-when-window-is-inactive#56463</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Hi,  Here&amp;#039;s is test project...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56462&amp;title=how-to-set-transparent-when-window-is-inactive#56462</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 12:47pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Here's is test project that should work.</DIV><DIV>&nbsp;</DIV><DIV><a href="https://forum.codejock.com/uploads/20100129_124724_Transparency.zip" target="_blank">uploads/20100129_124724_Transparency.zip</A>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 12:47:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56462&amp;title=how-to-set-transparent-when-window-is-inactive#56462</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Just for kicks to see if it works,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56459&amp;title=how-to-set-transparent-when-window-is-inactive#56459</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3253">Mr.Den</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 11:12am<br /><br /><strong>Just for kicks to see if it works, put&nbsp;this in a module:</strong><DIV>&nbsp;</DIV><DIV>Private Const GWL_EXSTYLE = (-20)<BR>Private Const WS_EX_LAYERED = &amp;H80000<BR>Private Const LWA_ALPHA = &amp;H2</DIV><DIV>&nbsp;</DIV><DIV>Private Declare Function GetWindowLong Lib "User32" _<BR>&nbsp; Alias "GetWindowLongA" (ByVal hwnd As Long, _<BR>&nbsp; ByVal nIndex As Long) As Long</DIV><DIV>&nbsp;</DIV><DIV>Private Declare Function SetWindowLong Lib "User32" _<BR>&nbsp;&nbsp; Alias "SetWindowLongA" (ByVal hwnd As Long, _<BR>&nbsp;&nbsp; ByVal nIndex As Long, ByVal dwNewLong As Long) _<BR>&nbsp;&nbsp; As Long</DIV><DIV>&nbsp;</DIV><DIV>Private Declare Function SetLayeredWindowAttributes Lib _<BR>&nbsp;&nbsp;&nbsp; "User32" (ByVal hwnd As Long, ByVal crKey As Long, _<BR>&nbsp;&nbsp;&nbsp; ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long<BR>&nbsp;&nbsp;&nbsp; <BR>Public Function TransForm(Form As Form, TransLevel As Byte) As Boolean</DIV><DIV>&nbsp;</DIV><DIV>On Error Resume Next<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; SetWindowLong Form.hwnd, GWL_EXSTYLE, WS_EX_LAYERED<BR>&nbsp;&nbsp;&nbsp; SetLayeredWindowAttributes Form.hwnd, 0, TransLevel, LWA_ALPHA<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; TransForm = Err.LastDllError = 0<BR>&nbsp;&nbsp;&nbsp; <BR>End Function</DIV><DIV>&nbsp;</DIV><DIV><strong>And call it from a form like this:</strong></DIV><DIV>&nbsp;</DIV><DIV>TransForm Me, 1</DIV><DIV>&nbsp;</DIV><DIV>That should make your form transparent.</DIV><DIV>&nbsp;</DIV><DIV>TransForm Me, 255</DIV><DIV>&nbsp;</DIV><DIV>To reverse the transparency</DIV><DIV>&nbsp;</DIV><DIV>If it barks at you, pass the number as a byte: CByte(255)</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 11:12:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56459&amp;title=how-to-set-transparent-when-window-is-inactive#56459</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Hey Aaron, I just tried it and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56452&amp;title=how-to-set-transparent-when-window-is-inactive#56452</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4108">shipwreck</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 7:53am<br /><br />Hey Aaron, I just tried it and it still doesn't seem to work for me. <br />Under the form_deactivate I have "FE.transparency = 150" and under form_activate I have "FE.transparency = 255" and when I run the app its as if I never put the code there to start with.]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 07:53:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56452&amp;title=how-to-set-transparent-when-window-is-inactive#56452</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Hi,  Did you try again? It really...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56451&amp;title=how-to-set-transparent-when-window-is-inactive#56451</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 7:35am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Did you try again? It really does work with code in activate and deactivate event. </DIV><DIV>&nbsp;</DIV><DIV>If you have DockingPanes and you click on PaneCaption it doesn't anymore <img src="https://forum.codejock.com/smileys/smiley5.gif" border="0"></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 07:35:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56451&amp;title=how-to-set-transparent-when-window-is-inactive#56451</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Hopefully they would. But if they...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56448&amp;title=how-to-set-transparent-when-window-is-inactive#56448</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4108">shipwreck</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 5:47am<br /><br />Hopefully they would. But if they don't I understand why. Most applications don't function like that anyhow. But I think I've actually tried using that and I couldn't get it to actually do anything. I was putting "formextender.transparency = 150" in the deactivate and "formextender.transparency = 255" and it was as if I never put any code there for some reason. Is there a better way to do this?]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 05:47:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56448&amp;title=how-to-set-transparent-when-window-is-inactive#56448</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Hi,  I tried again and it seems...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56443&amp;title=how-to-set-transparent-when-window-is-inactive#56443</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 3:27am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>I tried again and it seems that DockingPanes is causing this behaviour. If you click on one of the pane captions the form is grayed. Clicking somewhere else on other form seems to work fine. </DIV><DIV>&nbsp;</DIV><DIV><strong>Maybe CJ has an explanation for this?</strong></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 03:27:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56443&amp;title=how-to-set-transparent-when-window-is-inactive#56443</guid>
  </item> 
  <item>
   <title><![CDATA[How to set transparent when window is inactive??? : Hi,  You could use Form Activate...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56441&amp;title=how-to-set-transparent-when-window-is-inactive#56441</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 16086<br /><strong>Posted:</strong> 29 January 2010 at 2:39am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>You could use Form Activate and Deactivate event and set desired transparency. I tried it myself but sometimes form will loose it transparency entirely and only showing a "grayish shadow" and after resizing form repaints itself and everything is back to normal. Don't know why but is does...</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Jan 2010 02:39:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16086&amp;PID=56441&amp;title=how-to-set-transparent-when-window-is-inactive#56441</guid>
  </item> 
 </channel>
</rss>