diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
index 6856b27f..e6dd3c90 100644
--- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
+++ b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
@@ -1,7 +1,6 @@
using System;
using System.Diagnostics;
using System.Drawing;
-using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using TerraFX.Interop.Windows;
@@ -43,15 +42,17 @@ internal static unsafe class Win32ApplicationRunner
/// and it should be called as soon as the process is launched, excluding any other additional initialization needed.
///
/// The input application instance to run.
+ /// Name of the input application instance to run.
+ /// The title to use for the window being opened.
/// The exit code for the application.
- public static int Run(Win32Application application)
+ public static int Run(Win32Application application, string applicationName, string windowTitle)
{
Win32ApplicationRunner.application = application;
HMODULE hInstance = Windows.GetModuleHandleW(null);
- fixed (char* name = Assembly.GetExecutingAssembly().FullName)
- fixed (char* windowTitle = application.GetType().ToString())
+ fixed (char* name = applicationName)
+ fixed (char* title = windowTitle)
{
// Initialize the window class
WNDCLASSEXW windowClassEx = new()
@@ -79,7 +80,7 @@ internal static unsafe class Win32ApplicationRunner
hwnd = Windows.CreateWindowExW(
0,
windowClassEx.lpszClassName,
- (ushort*)windowTitle,
+ (ushort*)title,
WS.WS_OVERLAPPEDWINDOW,
Windows.CW_USEDEFAULT,
Windows.CW_USEDEFAULT,
@@ -162,7 +163,7 @@ internal static unsafe class Win32ApplicationRunner
}
///
- /// Processes incoming messages for a window.
+ /// Processes incoming messages for a window.
///
/// A handle to the window.
/// The message.
diff --git a/samples/ComputeSharp.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs
index d1606b2a..faf777c3 100644
--- a/samples/ComputeSharp.SwapChain/Program.cs
+++ b/samples/ComputeSharp.SwapChain/Program.cs
@@ -61,7 +61,7 @@ class Program
Console.WriteLine();
Console.WriteLine($"Starting {Samples[index].ShaderName}...");
- _ = Win32ApplicationRunner.Run(Samples[index].Application);
+ _ = Win32ApplicationRunner.Run(Samples[index].Application, "ComputeSharp.SwapChain", Samples[index].ShaderName);
}
}
while (index >= 0 && index < Samples.Length);
diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj
index 3f6df968..cdcb576b 100644
--- a/src/ComputeSharp/ComputeSharp.csproj
+++ b/src/ComputeSharp/ComputeSharp.csproj
@@ -41,7 +41,7 @@
-
+