Skip to content

Commit 5b82242

Browse files
committed
Add manual launch message
1 parent 4ea8630 commit 5b82242

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Modifications copyright (c) 2025 tanchekwei
2+
// Licensed under the MIT License. See the LICENSE file in the project root for details.
3+
using System;
4+
using System.Runtime.InteropServices;
5+
namespace WorkspaceLauncherForVSCode.Classes;
6+
7+
public static class NativeDialog
8+
{
9+
public static void Show(string title, string message)
10+
{
11+
_ = MessageBoxW(IntPtr.Zero, message, title, 0);
12+
}
13+
14+
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
15+
private static extern int MessageBoxW(
16+
IntPtr hWnd,
17+
string text,
18+
string caption,
19+
uint type);
20+
}

WorkspaceLauncherForVSCode/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public static void Main(string[] args)
3535
}
3636
else
3737
{
38-
Console.WriteLine("Not being launched as a Extension... exiting.");
38+
string productName = Constant.VisualStudioCodeDisplayName;
39+
NativeDialog.Show(
40+
productName,
41+
$"{productName} is a PowerToys Command Palette extension.\n\nInstall and enable PowerToys Command Palette,\n\nthen open {productName} extension from Command Palette.");
3942
}
4043
}
4144
catch (Exception ex)

0 commit comments

Comments
 (0)