<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>winJade &#187; api</title>
	<atom:link href="http://winjade.net/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://winjade.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 27 Jun 2010 23:47:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Mike Nash Roundtable</title>
		<link>http://winjade.net/2008/10/the-mike-nash-roundtable/</link>
		<comments>http://winjade.net/2008/10/the-mike-nash-roundtable/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 15:17:20 +0000</pubDate>
		<dc:creator>Bryant Zadegan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Beta 1]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Mike Nash Rules the World]]></category>
		<category><![CDATA[PDC]]></category>
		<category><![CDATA[PDC 2008]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.aeroxp.org/?p=601</guid>
		<description><![CDATA[ For those wondering, Mike Nash is (according to his business card) the “Corporate Vice President” for “Windows Product Management.”
Mike held a small roundtable for a number of pressies. He gave a quick rundown of things you all basically already know, so I took the time to ask a few questions which kept you guys [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-right: 0px; border-top: 0px; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px; display: inline" title="nash" border="0" alt="nash" align="right" src="http://winjade.net/wp-content/uploads/2008/10/nash-thumb.png" width="240" height="226" /> For those wondering, Mike Nash is (according to his business card) the “Corporate Vice President” for “Windows Product Management.”</p>
<p>Mike held a small roundtable for a number of pressies. He gave a quick rundown of things you all basically already know, so I took the time to ask a few questions which kept you guys in mind. The questions I asked:</p>
<ul>
<li>What’s the difference between “API Complete” (build 6801) is and “Feature Complete” (Beta 1)?</li>
<li>Why were lots of code samples and features being shown off for the Superbar at PDC when developers can’t develop for it? (Rafael’s extension of my API v. Feature Complete question)</li>
<li>Why were the sensor demonstrations missing from the Windows 7 keynote today?</li>
</ul>
<p>The answers to these questions can be found in the true-to-life* transcript after the break.</p>
<p> <span id="more-601"></span>
<p>*Given that this is a transcript, it may be wrought with grammatical errors, but this is exactly how the chat went down.</p>
<blockquote><p><strong>Bryant:</strong> I had a question which I had myself but my colleague Rafael phrased it much better than I did, and it kinda ties into your note about how the build given to developers here at PDC this week is “API Complete” whereas the builds you were… whereas beta 1 is going to be “Feature Complete” or at least that’s the attempt… my own question is: what’s the difference between “API Complete” and “Feature Complete”? More specifically, Rafael’s question is, um, he noted that there are a lot of sessions at PDC talking about the superbar, and <em>developing</em> for the superbar, and one session that he went to had a lot of code samples being shown, but he also took note that developers can’t even develop for it because the superbar isn’t even in the build. </p>
<p><strong>Mike: </strong>So the question really is, first of all, “What’s the difference between ‘API Complete’ and ‘Feature Complete’, and what is a developer to do who wants to write software that takes advantage of features that aren’t in the current ‘M3’ build.” So API complete, um, says that all the interfaces that developers are gonna code to… are in the product, and the third milestone of Windows 7 always had the goal of being API complete, which means&#160; we’re not going to add any more APIs subsequently. Feature complete means that all the functions that are gonna be part of Windows 7 are in that build, and our beta, which will ship early next year [<em>in time for CES</em>], will be Feature Complete. The real – One of the hard questions we had… which we faced, is “<em>Well</em>, do we give everyb—do we only demo the API Complete release even though we have been working since September when we cut M3, do we demo more than the M3 build” and the answer is “aaah! We only have these developers together that often. It’d seem like kind-of a shame to not show them everything we had,” which then begged the question “Well why don’t you just give them the build that Steven used on stage?” which was the stuff from last Friday. The answer is “Well, in order to stabilize that, we woulda had to start stabilizing it back in August to be done in September (which is kinda what we did), so we couldn’t give you something from last Friday at this scale, or at the same time, it’d seem like a shame to not show you everything that we had. So what you see here is that optimization. Is it perfect? <em>No.</em> I think the other thing—hey well I could tell anybody anything til it’s all the way done. The problem there is, you don’t give the ecosystem the chance to get going. So, you are here a little bit watching the sausage being made in the sense that you’re watching us have this dialog with our partners to make sure that they are ready so that when we get to beta, there’s some momentum for Windows 7, and then certainly as we get towards general availability for Windows 7, there’s a healthy set of things that take advantage of Windows 7 that are out there.</p>
<p><strong>Bryant:</strong> So, I guess tying back into the API Complete v. Feature Complete stuff, could a developer develop for the superbar in 6801?</p>
<p><strong>Mike</strong>: Certain aspects of it, yes; certain aspects of it, no.</p>
<p><strong>Bryant</strong>: Okay.</p>
<p><strong>Mike:</strong> and some of that is sorta enough work to do between now and then that when the beta comes out they can get, you know, have all those features be there.</p>
<p><strong>Bryant:</strong> Okay, thanks.</p>
<p><strong>Mike:</strong> Great question.</p>
<p><strong>Bryant: </strong>A few more questions, I guess, but… in the keynote that I saw today, there was one thing that was notably absent, and that was the sensor demos which were later discussed in the expo hall. Are you guys saving the sensor demonstrations &#8212; like the accelerometer demos, the touch demos and such… well not the touch demos so much but mostly just sensor work) &#8212; but are you saving that more for… WinHEC?</p>
<p><strong>Mike: </strong>If I told you, I’d have to kill you.</p>
<p><strong>Some other pressie:</strong> Cool!</p>
<p><strong>Mike: </strong>Okay, here’s the challenge. Today was the first time that we talked about Windows 7 in any scale, and I’d say, again, sorta the… how advanced this thing is – this phase, we’re further along than we’ve been at least in a long time. How much do people know? We’ve held a lot more back than ever, so today was like “WOW; lot to talk about and not a lot of time,” and we had to be sorta choiceful about what we talked about.</p>
<p><strong>Bryant:</strong> Yeah.</p>
<p><strong>Mike</strong>: Next week we have WinHEC – things that are about sorta the core of Windows 7 by default happened here. Things that are more… developer oriented… happened here. Things that are more hardware oriented, without being specific, you could expect to be in a convention center not unlike this one in a town with the same zipcode.</p>
<p><em>[laughter]</em></p>
<p><strong>Mike: </strong>Yeah, in about a week.</p>
</blockquote>
<p>Summary:</p>
<ul>
<li>What is API Complete v. Feature Complete? API Complete has the developer bits ready for the developers to work with, even if some of them are dead-ends for now. Feature Complete expands on this by making all of the APIs functional.</li>
<li>Why were code samples and such being shown off for the Superbar? Developers will be able to code for it anyway, but they’ll have enough to work with between now and Beta 1 that once Beta 1 hits the scene, they’ll have a good amount of code that doesn’t require functional awareness actually prepared.</li>
<li>Why were the sensor bits missing from the Windows 7 keynote? Because it’s more relevant to WinHEC, but there’s a session on that which I’ll be covering today, so it’s all good.</li>
</ul>
<p>There you have it. I’ll be covering today’s sensor demonstration at 10:30 today. I look forward to bringing you what I see.</p>
]]></content:encoded>
			<wfw:commentRss>http://winjade.net/2008/10/the-mike-nash-roundtable/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tweak DWM from your programs, Part 2</title>
		<link>http://winjade.net/2008/08/tweak-dwm-part-2/</link>
		<comments>http://winjade.net/2008/08/tweak-dwm-part-2/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 18:00:14 +0000</pubDate>
		<dc:creator>Stan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[dwm]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://www.aeroxp.org/?p=146</guid>
		<description><![CDATA[Following the first part of the Tweak DWM from your programs series, we are going to explore the actual usage of the Desktop Window Manager API in a Windows Forms-based program. The test application&#8211;included in the source package&#8211;also makes use of GlassBar, an extension to the existing control set.

Using GlassLib in your program
GlassLib is going [...]]]></description>
			<content:encoded><![CDATA[<p>Following the <a title="Tweak DWM from your programs, Part 1" href="/2008/07/tweak-dwm-part-1/">first part</a> of the <strong>Tweak DWM from your programs</strong> series, we are going to explore the actual usage of the <strong>Desktop Window Manager API</strong> in a Windows Forms-based program. The test application&#8211;included in the <a href="http://stoyanoff.info/code/dwm/GlassLib_pub.zip">source package</a>&#8211;also makes use of <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar.png" border="0" alt="glassbar" width="16" height="16" /><strong>GlassBar</strong>, an extension to the existing control set.<br />
<span id="more-146"></span><br />
<h3>Using GlassLib in your program</h3>
<p><span style="font-family: courier new;"><a href="http://winjade.net/wp-content/uploads/2008/08/project.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/project24.png" border="0" alt="project" width="16" height="15" /></a>GlassLib </span>is going to be main focus of this part of the series. It supersedes <span style="font-family: courier new;"><a href="http://winjade.net/wp-content/uploads/2008/08/project.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/project24.png" border="0" alt="project" width="16" height="15" /></a>DwmWrapper </span>by implementing a framework around <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar.png" border="0" alt="glassbar" width="16" height="16" /><span style="font-family: Courier New;">GlassBar</span> which can be used as a complement to your visually-rich forms. In order to use this library in your project, you have to do the following:</p>
<ol>
<li>Include <strong>a)</strong> a reference to the DLL in your project from Visual Studio: <em>Project</em> menu =&gt;<em> Add reference</em>, or <strong>b)</strong> the actual code files to your C# project (adding them as links (shortcuts) as opposed to copying them is more suitable if you wish include the files in multiple projects and/or wish to make changes to the code yourself).</li>
<li>Remember that all of the functionality lies in the <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/namespace-thumb.png" border="0" alt="namespace_" width="15" height="15" /><span style="font-family: courier new;">GlassLib </span>namespace. You can use the <span style="font-family: courier new;"><span style="color: #0000ff;">using</span> </span>or <span style="color: #0000ff;">Imports</span> clause in the beginning of your C# or VB.NET code file, respectively, or the global imports if you code exclusively in VB.NET.</li>
</ol>
<h3>Exploring the GlassLib Test app</h3>
<p>Let&#8217;s begin exploring the framework by opening the project file for <span style="font-family: courier new;"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/project24.png" border="0" alt="project" width="16" height="15" />GlassLibTest</span>. Included in the GlassLib solution, it depends on the <span style="font-family: courier new;"><a href="http://winjade.net/wp-content/uploads/2008/08/project.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/project24.png" border="0" alt="project" width="16" height="15" /></a>GlassLib </span>project reference, which on its part has all the <span style="font-family: courier new;"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/project24.png" border="0" alt="project" width="16" height="15" />DwmWrapper</span> code.</p>
<p>Open the <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/form.png" border="0" alt="form" width="15" height="15" />frmMain.cs file which is the form which is to be executed right at start up. As described in the first part, the first thing the class constructor <span><span style="font-family: Courier New;"><span style="color: #0000ff;">public</span> frmMain()</span></span> should do is to set <span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.ThrowExceptionTypes</span> to <span><span style="font-family: Courier New;"><span style="color: #2b91af;">DwmExceptionTypes</span>.None</span></span> in order to avoid any exceptions from being raised when DWM is not enabled or available on the OS, or if any function failed. The next thing the program does is to enable dragging from the Glass-extended area.</p>
<p><span style="font-family: Courier New;"><span style="color: #2b91af;">Dwm</span>.Glass[<span style="color: #0000ff;">this</span>].DragExtendedArea = <span style="color: #0000ff;">true</span>; </span>is useful if you want the extended area to act as the caption bar does, like in Windows Media Player. This is what the <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar.png" border="0" alt="glassbar" width="16" height="16" /><span style="font-family: Courier New;">GlassBar </span>toolbar does as well (more on this later in this part).</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/toolbox.png" border="0" alt="toolbox" width="216" height="99" align="right" /> Switch to Designer mode (<em>View</em> <em>=&gt; Designer</em>) and you can see the layout of the form: the usual Windows Forms buttons, combo and text boxes et cetera, but also <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar.png" border="0" alt="glassbar" width="16" height="16" /><span style="font-family: Courier New;">GlassBar</span>. To add the latter to your own forms, open the Toolbox (<em>View =&gt; Toolbox</em>) and drag it to your form (see figure on right). The toolbar will automatically dock to the bottom of it and extend Glass from this side of the form. You are free to dock it to the whole form (or container for that matter) or one of the other sides.</p>
<p>Because DWM only supports Glass on top-level windows, in designer mode <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar.png" border="0" alt="glassbar" width="16" height="16" /><span style="font-family: Courier New;">GlassBar</span> falls back to UXTheme API in order to get the theme-specific background image or brush which is suitable for all non-Aero Glass themes such as Aero Basic, Luna (on Windows XP) or Windows Classic on any supported Windows version. On top of this, you can choose to write your own <a href="http://winjade.net/wp-content/uploads/2008/08/class.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/class-thumb.png" border="0" alt="class" width="15" height="15" /></a><span style="font-family: Courier New;">GlassBarRenderer</span>.</p>
<p>This feature provides two key benefits to your application&#8217;s design:</p>
<ul>
<li>For Windows Vista systems and future OS with support for Glass: <em>rich, seamless Glass UI</em></li>
<li>For Windows Vista systems where DWM is disabled or unavailable, <strong>and</strong> all previous Windows releases: <em>seamless UI deriving from the appropriate Windows</em> <em>theme, including custom themes</em> <em>created with software such as </em><a href="http://www.windowblinds.net/"><em>WindowBlinds</em></a>.</li>
</ul>
<p align="center"><a href="http://winjade.net/wp-content/uploads/2008/08/glassbar-themes.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar-themes-thumb.png" border="0" alt="GlassBar &quot;dressed up&quot; in various Windows themes, including a custom GlassBarRenderer" width="700" height="267" /></a></p>
<h3>Managing the GlassBar items</h3>
<p>Adding your items to GlassBar is quite easy. While in Design Mode, make sure that the Properties pane is visible (<em>View </em>menu =&gt;<em> Properties Window </em>to invoke it), select <span style="font-family: courier new;">Items </span>and expand the Collection Editor. You can add, remove and rearrange the items. For each one of them you can customize their:</p>
<table style="width: auto;" border="0" cellspacing="2" cellpadding="2" width="1010">
<tbody>
<tr width="auto">
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb1.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Name</span></td>
<td width="802" valign="top">Used in code only (does not appear in UI)</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://www.aeroxp.org/wp-content/uploads/2008/08/property-thumb11.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Enabled</span></td>
<td width="794" valign="top">Enables/disables the item from the UI</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Icon</span></td>
<td width="787" valign="top">Preferably translucent PNG image 25&#215;25 pixels in size</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">IsSeparator</span></td>
<td width="782" valign="top">Denotes whether the item is a separator (its Icon will be disregarded)</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Overlay</span></td>
<td width="777" valign="top">Image, useful for &#8216;hover&#8217; effects</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Text</span></td>
<td width="773" valign="top">Alternative text shown when the item is hovered</td>
</tr>
<tr>
<td width="10" valign="top"></td>
<td width="188" valign="top"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Visible</span></td>
<td width="770" valign="top">Shows/hides the item</td>
</tr>
</tbody>
</table>
<p>You can of course manage items programmatically using the <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb1.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Items </span>property, for example adding one:</p>
<p><span><span style="font-family: Courier New;"><span style="color: #2b91af;">Image</span> img = <span style="color: #2b91af;">Image</span>.FromFile(<span style="color: #a31515;">&#8220;someFile.png&#8221;</span>);</span></span></p>
<p><span><span style="font-family: Courier New;"><span style="color: #2b91af;">GlassBarItem</span> gbi = <span style="color: #0000ff;">new</span> <span style="color: #2b91af;">GlassBarItem</span>(<span style="color: #a31515;">&#8220;Sample Text&#8221;</span> + i, img);</span></span></p>
<p><span style="font-family: Courier New;">glassBar.Items.Add(gbi);</span></p>
<p>When the logic of your program requires an item be disabled or hidden, e.g. an unavailable feature, you can use <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://www.aeroxp.org/wp-content/uploads/2008/08/property-thumb11.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Enabled </span>or <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: courier new;">Visible </span>to prevent users from clicking it.</p>
<h3>Custom renderers</h3>
<p>Internally GlassBar defines a standard renderer which on Windows Vista with Aero Glass enables draws on a translucent surface and otherwise falls back to the system-defined theme. If you wish to code a custom renderer for your needs, what you have to do is:</p>
<ol>
<li>Create a class deriving from (inheriting) from one of the following classes:
<ul>
<li><a href="http://winjade.net/wp-content/uploads/2008/08/class.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/class-thumb.png" border="0" alt="class" width="15" height="15" /></a><span style="font-family: Courier New;">GlassLib.Rendering.DefaultGlassBarRenderer</span> if you wish to customize only specific parts of the default renderer (images, background etc)</li>
<li><a href="http://winjade.net/wp-content/uploads/2008/08/class.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/class-thumb.png" border="0" alt="class" width="15" height="15" /></a><span style="font-family: Courier New;">GlassLib.Rendering.GlassBarRenderer</span> if you wish to build one from the ground up. This requires you to implement all of the methods and properties and is unlikely to be your choice.</li>
</ul>
</li>
<li>Decide which functions or images you would like to change. You can assign any image to <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/property-thumb12.png" border="0" alt="property_thumb1" width="16" height="15" /><span style="font-family: Courier New;">MainPiece, RightSecondaryStates, AnimationStrip etc.</span></li>
<li>The <img style="border-right: 0px; border-top: 0px; margin: 0px 3px 0px 0px; border-left: 0px; border-bottom: 0px" src="http://winjade.net/wp-content/uploads/2008/08/method-thumb1.png" border="0" alt="method_thumb1" width="16" height="15" /><span style="font-family: courier new;">DrawBarBackground </span>function is called every time the UI changes and needs to be redrawn. It is here where you can change most of the behavior of the default renderer and implement your own features.</li>
<li>Assign an instance of your custom renderer to <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/glassbar.png" border="0" alt="glassbar" width="16" height="16" /><span style="font-family: Courier New;">GlassBar</span>
<ul>
<li><span style="font-family: Courier New;">glassBar.Renderer = <span style="color: #0000ff;">new</span> <span style="color: #2b91af;">CustomRenderer</span>();</span> or to revert to default:</li>
<li><span style="font-family: Courier New;">glassBar.Renderer = <span style="color: #0000ff;">new</span> GlassLib.Rendering.<span style="color: #2b91af;">DefaultGlassBarRenderer</span>();</span></li>
</ul>
</li>
</ol>
<h3>The test app</h3>
<p>There is a test program added to the package, <a href="file:///C:/Users/Stan/AppData/Roaming/Windows Live Writer/PostSupportingFiles/746266d3-e326-4c4e-8fb9-15492f646457/project3.png"><strong><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/08/project-thumb12.png" border="0" alt="project_thumb1" width="16" height="15" /></strong></a><span style="font-family: courier new;">GlassLibTest</span>, whose code and compiled binary you can explore and experiment with GlassBar and DWM.</p>
<p>If you have any comments, questions, wishes or just an opinion, I would be happy to hear it.</p>
]]></content:encoded>
			<wfw:commentRss>http://winjade.net/2008/08/tweak-dwm-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tweak DWM from your programs, Part 1</title>
		<link>http://winjade.net/2008/07/tweak-dwm-part-1/</link>
		<comments>http://winjade.net/2008/07/tweak-dwm-part-1/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 16:13:39 +0000</pubDate>
		<dc:creator>Stan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[dwm]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://www.aeroxp.org/?p=80</guid>
		<description><![CDATA[With Windows Vista, Microsoft introduced a whole new window manager which provides a better experience to the user and an independent graphics surface to us developers by taking advantage of graphics acceleration hardware (your graphics card or integrated GPU).
In a three-part blog post, I will show you how to use a wrapper around the Desktop [...]]]></description>
			<content:encoded><![CDATA[<p>With Windows Vista, Microsoft introduced a whole new window manager which provides a better experience to the user and an independent graphics surface to us developers by taking advantage of graphics acceleration hardware (your graphics card or integrated GPU).</p>
<p>In a three-part blog post, I will show you how to use a wrapper around the <strong>Desktop Window Manager</strong> Application Programming Interface in order to control its state, change colorization, or change the rendering policy of windows from your Windows Forms and .NET 3 Presentation Foundation programs.</p>
<p><span id="more-80"></span></p>
<h2>Getting Started</h2>
<p><em>Windows Forms and Windows Presentation Foundation will be referred to in these posts as WF and WPF respectively.</em></p>
<p>The code you will need can be <a href="http://stoyanoff.info/code/dwm/GlassLib_pub.zip" target="_blank">downloaded from here</a> and is written in C# (as are the code samples in this post). That being said, you can use it in projects of any other .NET language &#8212; you can include the compiled libraries as references. Otherwise (if you code in C#), you also have the option to include the files in your project and not distribute a separate library. The solution is for use in Visual Studio 2005 but is also compatible with version 2008.</p>
<p>The whole framework is located under the <strong><a href="http://winjade.net/wp-content/uploads/2008/07/namespace.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/namespace-thumb.png" border="0" alt="namespace_" width="15" height="15" /></a></strong><span style="font-family: courier new;">GlassLib</span> namespace and is the source to three main types of projects:</p>
<ul>
<li><strong><a href="http://winjade.net/wp-content/uploads/2008/07/project.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/project-thumb.png" border="0" alt="project" width="16" height="15" /></a></strong><span style="font-family: courier new;">DwmWrapper</span> is a .NET wrapper around the DWM API, which can be compiled in the following flavors:
<ul>
<li><strong>No dependency</strong> on WF or WPF. It can be used to avoid DLL clutter when coding command-line applications to manipulate the DWM.</li>
<li>Solely <strong>WF</strong> or <strong>WPF</strong></li>
<li><strong>Both</strong> for mixed-framework projects.</li>
</ul>
</li>
<li><a href="http://winjade.net/wp-content/uploads/2008/07/project.png"><strong><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/project-thumb.png" border="0" alt="project" width="16" height="15" /></strong></a><span style="font-family: courier new;">GlassLib</span> is a WF-powered layer above <strong><a href="http://winjade.net/wp-content/uploads/2008/07/project.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/project-thumb.png" border="0" alt="project" width="16" height="15" /></a></strong><span style="font-family: courier new;">DwmWrapper</span> and provides a set of classes, including the <a href="http://winjade.net/wp-content/uploads/2008/07/class.png"><strong><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 4px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/class-thumb.png" border="0" alt="class" width="15" height="15" /></strong></a><span style="font-family: courier new;">GlassBar</span> control for use in your forms</li>
<li><strong><strong><a href="http://winjade.net/wp-content/uploads/2008/07/project.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/project-thumb.png" border="0" alt="project" width="16" height="15" /></a></strong></strong>The <span style="font-family: courier new;">Test Projects</span> you can use to try the various features that the two other projects have. They will be used here ad hoc.</li>
</ul>
<p><img style="border-top-width: 0px; border-left-width: 0px; float: right; border-bottom-width: 0px; margin: 8px 4px 8px 8px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/dwm-test-app1.png" border="0" alt="DWM test app" width="200" height="109" />In this first part, we will explore the architecture of the wrapper, its core functionality and application in Windows Forms programs.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa969540.aspx" target="_blank">Microsoft provides an API for DWM</a> in the equivocal DwmApi library. Encapsulating it for easier use in .NET programs is the wrapper&#8217;s main purpose.</p>
<p>Since all necessary classes are located under the <a href="http://winjade.net/wp-content/uploads/2008/07/namespace.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/namespace-thumb.png" border="0" alt="namespace_" width="15" height="15" /></a><span style="font-family: courier new;">GlassLib</span> namespace, in order to avoid writing it every time, I would suggest that you insert it in your C# or VB code file&#8217;s &#8220;imports&#8221; or, if you are working exclusively with VB, in your project&#8217;s &#8220;Imported Namespaces&#8221; list in order to avoid doing the first as well.</p>
<p>The most important class is <a href="http://winjade.net/wp-content/uploads/2008/07/class.png"><strong><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/class-thumb.png" border="0" alt="class" width="15" height="15" /></strong></a><span style="font-family: courier new;">Dwm</span> and can be used to control virtually any aspect of DWM as long as the public API allows it. The various features are available via the following properties of <a href="http://winjade.net/wp-content/uploads/2008/07/class.png"><strong><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/class-thumb.png" border="0" alt="class" width="15" height="15" /></strong></a><span style="font-family: courier new;">Dwm</span>:</p>
<table style="width: auto;" border="0" cellspacing="2" cellpadding="2" width="1019">
<tbody>
<tr width="auto">
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Blur</span></td>
<td width="802" valign="top">Enables/disables the black background transition when a window (not necessarily <em>your</em> window) is maximized, sets custom blur region</td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Colorization</span></td>
<td width="794" valign="top">Gets/sets the Aero Glass colorization</td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Composition</span></td>
<td width="787" valign="top">Enable/disable DWM, check if running and if the system is DWM-capable</td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Events</span></td>
<td width="782" valign="top">Used to set up notifications for colorization, composition, non-client rendering or window-maximized changes</td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Flip3D</span></td>
<td width="777" valign="top">Start/Stop Windows Flip3D or Flip</td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Glass</span></td>
<td width="773" valign="top">Enable/disable Glass on a given form (via its instance, e.g. <span style="color: #0000ff; font-family: courier new;">this</span>) or window (via its handle/hWnd, an <span style="font-family: courier new;"><a href="http://winjade.net/wp-content/uploads/2008/07/class.png"><strong><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/class-thumb.png" border="0" alt="class" width="15" height="15" /></strong></a>IntPtr</span>)</td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="188" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">NonClientArea</span></td>
<td width="770" valign="top">For advanced users only, gets or sets how DWM is handing the painting of a given form or window (see <a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">Glass</span> above)</td>
</tr>
</tbody>
</table>
<h2>Using the Wrapper</h2>
<p>Note that DWM is only available on Windows Vista, so I would suggest that you select how to handle the wrapper&#8217;s behavior on earlier operating systems. Otherwise, exceptions will be raised which you will have to catch.</p>
<p>The first option is to limit the exceptions the wrapper will raise by setting <a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.ThrowExceptionTypes</span> to one of the available <a href="http://winjade.net/wp-content/uploads/2008/07/options.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/options-thumb.png" border="0" alt="options" width="15" height="15" /></a><span style="font-family: courier new;">DwmExceptionTypes</span></p>
<table style="width: auto;" border="0" cellspacing="2" cellpadding="2" width="1019">
<tbody>
<tr width="auto">
<td width="10" valign="top"> </td>
<td width="995" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">None</span></td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="995" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">UnsupportedFeatures</span></td>
</tr>
<tr>
<td width="10" valign="top"> </td>
<td width="995" valign="top"><a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;">DesktopWindowManager</span></td>
</tr>
</tbody>
</table>
<p>Raising no exception will most likely suit your needs best so adjust this property before you make any other changes to DWM, preferably at program startup or in the form&#8217;s constructor.</p>
<p><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.ThrowExceptionTypes = <span style="color: #2b91af;">DwmExceptionTypes</span>.None;</span></p>
<p>Now you can make any changes you want to your form&#8217;s state in the DWM, for example enable Glass&#8211;it is as easy as writing</p>
<p><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.Glass[<span style="color: #0000ff;">this</span>] = <span style="color: #0000ff;">new</span> <span style="color: #2b91af;">DwmMargins</span>(100, 4, 8, 20);</span></p>
<p>where <span style="color: #0000ff; font-family: courier new;">this</span> is the instance of the form (you can replace this with any other form instance you would like) and the margins are defined as left-right-top-bottom. You can use <a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;"><span style="color: #2b91af;">DwmMargins</span>.EntireWindow</span> instead to extend glass in the whole window client area, like Mobility Center does in Windows Vista.</p>
<p>Restoring the default borders is done by calling the <a href="http://winjade.net/wp-content/uploads/2008/07/method.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/method-thumb.png" border="0" alt="method" width="16" height="15" /></a><span style="font-family: courier new;">Restore</span> method.</p>
<p><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.Glass[<span style="color: #0000ff;">this</span>].Restore();</span></p>
<p>Receiving notifications on the global DWM state or on your forms&#8217; is important in order to know how you should handle painting backgrounds or the non-client area. You can choose to get notified when the Aero Glass colorization is changed or DWM starts up or shuts down. In GlassLib this is straightforward: each form that you wish to be notification-aware, GlassLib will include in its list and you have to attach your handlers to the colorization, composition, non-client rendering or window-maximized changes.</p>
<p><span><span style="font-family: courier new;"><span style="color: #2b91af;"><img style="border-top-width: 0px; border-left-width: 0px; float: right; border-bottom-width: 0px; margin: 8px 4px 8px 8px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/dwm-colorizations1.png" border="0" alt="DWM colorizations" width="200" height="140" /> Dwm</span>.Events[<span style="color: #0000ff;">this</span>].AddHandlers(); // Notifying GlassLib&#8230;</span></span></p>
<p><span style="font-family: courier new;">// Add our handlers</span></p>
<p><span><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.Events[<span style="color: #0000ff;">this</span>].CompositionChanged += new <span style="color: #2b91af;">DwmEventHandler</span>(OnCompositionChanged);<br />
<span style="color: #2b91af;">Dwm</span>.Events[<span style="color: #0000ff;">this</span>].ColorizationChanged += new <span style="color: #2b91af;">DwmEventHandler</span>(OnColorizationChanged);</span></span></p>
<p><span style="font-family: courier new;">&#8230;</span></p>
<p><span><span style="font-family: courier new;"><span style="color: #0000ff;">private void </span>OnCompositionChanged(object sender, DwmEventArgs e)<br />
{<br />
// Update the UI on composition change (extend glass if DWM is enabled, otherwise restore)<br />
if (<span style="color: #2b91af;">Dwm</span>.Glass[<span style="color: #0000ff;">this</span>].Enabled)<br />
<span style="color: #2b91af;">Dwm</span>.Glass[<span style="color: #0000ff;">this</span>].Margins = new <span style="color: #2b91af;">DwmMargins</span>(100, 4, 8, 20);<br />
else<br />
<span style="color: #2b91af;">Dwm</span>.Glass[<span style="color: #0000ff;">this</span>].Restore();<br />
}</span></span></p>
<p><span><span style="font-family: courier new;"><span style="color: #0000ff;">private void</span> OnColorizationChanged(object sender, DwmEventArgs e)<br />
{<br />
<span style="color: #2b91af;">MessageBox</span>.Show(e.Colorization.ToString());<br />
}</span></span></p>
<p><span><span style="font-family: courier new;"><span style="color: #2b91af;"><img style="border-top-width: 0px; border-left-width: 0px; float: right; border-bottom-width: 0px; margin: 8px 4px 8px 8px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/flip3d1.png" border="0" alt="Flip 3D" width="200" height="134" /></span></span></span>Although the public DWM API does not make it easy for one to change the colorization programmatically, DwmWrapper exposes this functionality through the <a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.Colorization </span>property. Controlling the Desktop Window Manager is also as easy as setting <a href="http://winjade.net/wp-content/uploads/2008/07/property.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/property-thumb.png" border="0" alt="property" width="16" height="15" /></a><span style="font-family: courier new;"><span style="color: #2b91af;">Dwm</span>.Composition.Enabled </span>to the desired value, either <span style="color: #0000ff; font-family: courier new;">true</span> or <span style="color: #0000ff; font-family: courier new;">false</span>. Other useful &#8220;one-liners&#8221; include invoking Windows Flip and Flip 3D: <a href="http://winjade.net/wp-content/uploads/2008/07/method.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/method-thumb.png" border="0" alt="method" width="16" height="15" /></a><span style="font-family: courier new;">Dwm.Flip3D.EnterAltTab(); </span>and <a href="http://winjade.net/wp-content/uploads/2008/07/method.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 3px 0px 0px; border-right-width: 0px" src="http://winjade.net/wp-content/uploads/2008/07/method-thumb.png" border="0" alt="method" width="16" height="15" /></a><span style="font-family: courier new;">Dwm.Flip3D.Enter();</span>, respectively.</p>
<p>You can tinker with the <a href="http://stoyanoff.info/code/dwm/GlassLib_pub.zip" target="_blank">full GlassLib source code</a> and the included test projects to see how all of the aforementioned features work in a real environment. In the next part I am going to cover the more advanced functionality of the wrapper, the Windows Forms test app and how it manages DWM thumbnails.</p>
<p>If you have any comments, questions, wishes or just an opinion, feel free to post it here.</p>
<p><strong>Part 2 coming soon&#8230;</strong></p>
<p><strong><em>You are free to use GlassLib in your freeware programs, but please at least acknowledge it in your release notes/about dialog/website. In case your program is commercial/shareware, I would appreciate it if you could <a href="http://stoyanoff.info/contact/" target="_blank">contact</a> me beforehand. Thanks.</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://winjade.net/2008/07/tweak-dwm-part-1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
