<?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>Win32 &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/win32/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 08 Aug 2023 22:37:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Introducing DesktopXAMLContainer</title>
		<link>https://blog.xojo.com/2023/08/09/introducing-desktopxamlcontainer/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Wed, 09 Aug 2023 13:30:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[WinUI]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=11689</guid>

					<description><![CDATA[For those developing on Windows, Xojo 2023r2 leverages the power of XAML to offer the ability to include WinUI controls alongside existing Win32 controls in Windows apps.]]></description>
										<content:encoded><![CDATA[
<p>For those developing on Windows, <a href="https://xojo.com/download/">Xojo 2023r2</a> leverages the power of XAML to offer the ability to include WinUI controls alongside existing Win32 controls in Windows apps.</p>



<h3 class="wp-block-heading">First, what is XAML?</h3>



<p>XAML is a markup language based on an extension of XML which you can use to define your layouts that work with the <a href="https://documentation.xojo.com/api/user_interface/desktop/desktopxamlcontainer.html">DesktopXAMLContainer</a>.</p>



<h3 class="wp-block-heading">Can you show me an example of XAML?</h3>



<p>Here is a simple example that creates a WinUI Button using XAML:</p>



<pre id="Xojo" class="wp-block-code"><code><code>&lt;Button Content="Hello World" /&gt;</code></code></pre>



<p><em>Note: XAML is case sensitive so <code>&lt;button Content="Hello World" /&gt;</code> would be an error because &#8220;button&#8221; needs to be capitalized to &#8220;Button&#8221;</em></p>



<h3 class="wp-block-heading">Great but where do I put this XAML code?</h3>



<p>The XAML code can be added to the DesktopXAMLContainer&#8217;s Content property. First, find and add the DesktopXAMLContainer control to your layout.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="625" src="https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-1024x625.png" alt="" class="wp-image-11692" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-1024x625.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-300x183.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-768x469.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer-1536x938.png 1536w, https://blog.xojo.com/wp-content/uploads/2023/07/FindDesktopXAMLContainer.png 1883w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Next, add the XAML code to the Content property, the Layout Editor should now update with a visual of a WinUI Button.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="499" src="https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-1024x499.png" alt="" class="wp-image-11693" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-1024x499.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-300x146.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere-768x374.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/AddContentHere.png 1436w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Are there other XAML controls I can add?</h3>



<p>Yes, we provide a convenient list of XAML controls that can be added to your layout if you open up the XAML Control Chooser dialog, by bringing up the contextual menu for that control.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="723" src="https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-1024x723.png" alt="" class="wp-image-11695" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-1024x723.png 1024w, https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-300x212.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu-768x542.png 768w, https://blog.xojo.com/wp-content/uploads/2023/07/ChooseXAMLControlMenu.png 1471w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>This list includes 30+ controls that are ready to be added to your layout with helpful documentation on the side.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="829" height="647" src="https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1.png" alt="" class="wp-image-11698" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1.png 829w, https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1-300x234.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/ButtonClickEvent-1-768x599.png 768w" sizes="auto, (max-width: 829px) 100vw, 829px" /></figure>



<h3 class="wp-block-heading">Neat, so how do you handle events?</h3>



<p>All XAML related events are filtered to the DesktopXAMLContainer.EventTriggered event. In this event you have the opportunity to check the name of the event that triggered it. For our Button example, we note that it fires a &#8220;Click&#8221; event.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="900" height="463" src="https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered.png" alt="" class="wp-image-11699" srcset="https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered.png 900w, https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered-300x154.png 300w, https://blog.xojo.com/wp-content/uploads/2023/07/EventTriggered-768x395.png 768w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure>



<p>To see more of you can do with XAML, make sure to check out Xojo&#8217;s Example Projects included in the Examples folder of the <a href="https://xojo.com/download/">Xojo Download</a>, the <a href="https://documentation.xojo.com/api/user_interface/desktop/desktopxamlcontainer.html">Xojo Documentation</a> and <a href="https://blog.xojo.com/2023/08/09/doing-more-with-desktopxamlcontainer/">Doing More With DesktopXAMLContainer</a>.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Welcome to the Dark Side of Windows</title>
		<link>https://blog.xojo.com/2021/11/18/welcome-to-the-dark-side-of-windows/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Thu, 18 Nov 2021 14:00:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[DarkMode]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=9602</guid>

					<description><![CDATA[Starting with Xojo 2021r3, the Windows IDE is now themed for dark mode. This is because we've added support for dark mode aware Windows apps.  But wait, how is that even possible with Win32 controls? ]]></description>
										<content:encoded><![CDATA[
<p>Starting with Xojo 2021r3, the Windows IDE is now themed for dark mode. This is because we&#8217;ve added support for dark mode aware Windows apps.  But wait, how is that even possible with Win32 controls?  Well&#8230;</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1514" height="1026" src="https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkModeInIDE.png" alt="" class="wp-image-9603" srcset="https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkModeInIDE.png 1514w, https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkModeInIDE-300x203.png 300w, https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkModeInIDE-1024x694.png 1024w, https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkModeInIDE-768x520.png 768w" sizes="auto, (max-width: 1514px) 100vw, 1514px" /><figcaption>Windows IDE in dark mode</figcaption></figure></div>



<p>While not perfect, Microsoft has always provided enough capabilities (for the most part) to get Win32 controls themed for dark mode.  Some Win32 controls they even themed correctly from the beginning when Microsoft first introduced dark mode on Windows. However, there are a few controls that are not supported in dark mode, such as TabPanels, autocompleting ComboBoxes, and DateTimePicker.</p>



<p>To opt into dark mode, just enable it in the shared build settings (by default this is enabled).</p>



<div class="wp-block-image"><figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2021/11/SupportsDarkMode.png" alt="" class="wp-image-9604" width="292" height="192"/></figure></div>



<p>Not ready for dark mode?  Simply disable that option and your app will continue to operate in light mode as before. When you are ready for dark mode, make any necessary image adjustments and make sure to use the appropriately themed colors (for example Color.TextColor) in places that need it. For dark mode customization use the Color.IsDarkMode to check if the OS is in dark mode.  To theme colors differently between light and dark mode, add a ColorGroup and assign them to the controls that need them. Once you&#8217;re done with your tweaks, enjoy the dark side of Windows!</p>



<div class="wp-block-image"><figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkMode.png" alt="" class="wp-image-9605" width="915" height="727" srcset="https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkMode.png 1026w, https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkMode-300x239.png 300w, https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkMode-1024x814.png 1024w, https://blog.xojo.com/wp-content/uploads/2021/11/EddiesDarkMode-768x611.png 768w" sizes="auto, (max-width: 915px) 100vw, 915px" /><figcaption>Eddies Electronics running in dark mode with one line code tweak for Color.TextColor and some toolbar image updates.</figcaption></figure></div>



<p>For additional capabilities, you can disable dark mode theming (even when you have the dark mode support enabled) in your app by setting up the XOJO_WIN32_DARKMODE_DISABLED environment variable (either set to &#8220;true&#8221; or &#8220;1&#8221;)  in your App.Opening event.</p>



<p>Learn more in the <a href="https://documentation.xojo.com/topics/user_interface/desktop/macos/supporting_macos_dark_mode.html">Xojo Documentation</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
