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 8
8
9
9
namespace Flow . Launcher . Plugin . Program . Programs
10
10
{
11
- class ShellLinkHelper
11
+ public class ShellLinkHelper
12
12
{
13
-
14
13
// Reference : http://www.pinvoke.net/default.aspx/Interfaces.IShellLinkW
15
14
[ ComImport ( ) , Guid ( "00021401-0000-0000-C000-000000000046" ) ]
16
15
public class ShellLink
@@ -28,7 +27,9 @@ public unsafe string retrieveTargetPath(string path)
28
27
const int STGM_READ = 0 ;
29
28
( ( IPersistFile ) link ) . Load ( path , STGM_READ ) ;
30
29
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 ) ;
32
33
33
34
const int MAX_PATH = 260 ;
34
35
Span < char > buffer = stackalloc char [ MAX_PATH ] ;
@@ -79,6 +80,6 @@ public unsafe string retrieveTargetPath(string path)
79
80
Marshal . ReleaseComObject ( link ) ;
80
81
81
82
return target ;
82
- }
83
+ }
83
84
}
84
85
}
You can’t perform that action at this time.
0 commit comments