Skip to content

Commit 7f63050

Browse files
authored
Improved context menu load time (#1921)
1 parent c246712 commit 7f63050

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Files.Launcher/Program.cs

+5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ private static void Main(string[] args)
8080
watchers.Add(watcher);
8181
}
8282

83+
// Preload context menu for better performace
84+
// We query the context menu for the app's local folder
85+
var preloadPath = ApplicationData.Current.LocalFolder.Path;
86+
using var _ = Win32API.ContextMenu.GetContextMenuForFiles(new string[] { preloadPath }, Shell32.CMF.CMF_NORMAL);
87+
8388
// Connect to app service and wait until the connection gets closed
8489
appServiceExit = new AutoResetEvent(false);
8590
InitializeAppServiceConnection();

0 commit comments

Comments
 (0)