File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Plugins/Flow.Launcher.Plugin.Program/Programs Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 88
99namespace Flow . Launcher . Plugin . Program . Programs
1010{
11- class ShellLinkHelper
11+ public class ShellLinkHelper
1212 {
13-
1413 // Reference : http://www.pinvoke.net/default.aspx/Interfaces.IShellLinkW
1514 [ ComImport ( ) , Guid ( "00021401-0000-0000-C000-000000000046" ) ]
1615 public class ShellLink
@@ -28,7 +27,9 @@ public unsafe string retrieveTargetPath(string path)
2827 const int STGM_READ = 0 ;
2928 ( ( IPersistFile ) link ) . Load ( path , STGM_READ ) ;
3029 var hwnd = new HWND ( IntPtr . Zero ) ;
31- ( ( IShellLinkW ) link ) . Resolve ( hwnd , 0 ) ;
30+ // Use SLR_NO_UI to avoid showing any UI during resolution, like Problem with Shortcut dialogs
31+ // https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishelllinka-resolve
32+ ( ( IShellLinkW ) link ) . Resolve ( hwnd , ( uint ) SLR_FLAGS . SLR_NO_UI ) ;
3233
3334 const int MAX_PATH = 260 ;
3435 Span < char > buffer = stackalloc char [ MAX_PATH ] ;
@@ -79,6 +80,6 @@ public unsafe string retrieveTargetPath(string path)
7980 Marshal . ReleaseComObject ( link ) ;
8081
8182 return target ;
82- }
83+ }
8384 }
8485}
You can’t perform that action at this time.
0 commit comments