<p>I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked.</p>

<p>Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and  Windows Live Photo Gallery come to mind as examples.)  I know that one way to accomplish this from WinForms would be to create a borderless form and draw the caption bar/buttons yourself, then overriding <code>WndProc</code> to make sure moving, resizing, and button clicks do what they're supposed to do (I'm not clear on the specifics but could probably pull it off given a day to read documentation.)  I'm curious if there's a different, easier way that I'm overlooking.  Perhaps some API calls or window styles I've overlooked?</p>

<p>I believe Google has answered it for me by using the roll-your-own-window approach with Chrome.  I will leave the question open for another day in case someone has new information, but I believe I have answered the question myself.</p>

[{'answer_id': 42481, 'author': 'Pascal', 'author_id': 1311, 'author_profile': 'https://Stackoverflow.com/users/1311', 'pm_score': 0, 'selected': False, 'text': '<p>Nope, I am afraid, there is no other easy way of doing this. </p>\n\n<p>You are on the right track. You will need to create a custom Winform and then proceed as illustrated in this <a href="http://codemaverick.blogspot.com/2007/02/creating-custom-winforms-in-net-20-yes.html" rel="nofollow noreferrer">example</a>.</p>\n'}, {'answer_id': 42768, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 0, 'selected': False, 'text': '<p>Google Chrome uses the Windows Vista SDK to get the glass look on XP. You can download it here:</p>\n\n<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065&amp;displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065&amp;displaylang=en</a></p>\n\n<p>Using this, you need to enabled delay loading of the following DLL\'s to get the Glass Effect in XP:</p>\n\n<ul>\n<li>uxtheme.dll </li>\n<li>dwmapi.dl</li>\n</ul>\n'}, {'answer_id': 43015, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>@Jonathan Holland: Is this something that can be done from .NET?</p>\n</blockquote>\n\n<p>Yes, using DllImport. <a href="http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx" rel="nofollow noreferrer">Here</a> is a good blog post</p>\n'}, {'answer_id': 44398, 'author': 'OwenP', 'author_id': 2547, 'author_profile': 'https://Stackoverflow.com/users/2547', 'pm_score': 3, 'selected': False, 'text': '<p>Google Chrome is <em>not</em> using the Vista SDK to achieve this on XP.  If you peek into <code>src\\chrome\\browser\\views\\frame</code> there are several files to define the browser frame depending on the capabilities of the system.  On XP, it looks like <code>OpaqueFrame</code> is used; line 19 has this to say:</p>\n<pre><code>// OpaqueFrame\n//\n//  OpaqueFrame is a CustomFrameWindow subclass that in conjunction with\n//  OpaqueNonClientView provides the window frame on Windows XP and on Windows\n//  Vista when DWM desktop compositing is disabled. The window title and\n//  borders are provided with bitmaps.</code></pre>\n<p>It looks like it\'s using the resources in <code>src\\chrome\\app\\theme</code> to draw the frame buttons.</p>\n<p>So it looks like my hopes that there\'s some kind of cheap way to enable Vista theming on XP are dashed.  The only way to do it is to manually draw the non-client area of your window.  I believe <a href="https://web.archive.org/web/20200729101531/http://geekswithblogs.net:80/kobush/articles/CustomBorderForms.aspx" rel="nofollow noreferrer">something like this</a> is probably the right track, since it lets Windows handle the non-client stuff like moving and resizing the window.</p>\n<p>Unless someone can find a method to magically enable the Vista theming on XP, this is the answer to the question but I obviously cannot mark my own post as the answer.</p>\n'}, {'answer_id': 46925, 'author': 'Judah Gabriel Himango', 'author_id': 536, 'author_profile': 'https://Stackoverflow.com/users/536', 'pm_score': 2, 'selected': False, 'text': '<p>Owen, I\'m using Chrome on XP and I don\'t see "Vista Aero" glass theme on the Chrome window. I see it as solid blue.</p>\n\n<p>If it\'s custom theming of controls and windows title bars you want, that can be accomplished. There\'s an excellent, free UI toolkit for WinForms that does exactly that: <a href="http://www.componentsource.com/products/krypton-toolkit/index.html" rel="nofollow noreferrer">KryptonToolkit</a></p>\n'}, {'answer_id': 107103, 'author': 'Chris Pietschmann', 'author_id': 7831, 'author_profile': 'https://Stackoverflow.com/users/7831', 'pm_score': 5, 'selected': True, 'text': '<p>Here\'s an article with full code sample on how to use your own custom &quot;chrome&quot; for an application:</p>\n<p><a href="https://web.archive.org/web/20200718062913/http://geekswithblogs.net:80/kobush/articles/CustomBorderForms3.aspx" rel="nofollow noreferrer">http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx</a></p>\n<p>This looks like some really good stuff. There are a total of 3 articles in it\'s series, and it runs great, and on Vista too!</p>\n'}]
['https://Stackoverflow.com/questions/42460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2547/']