Fix setting issue and everything sdk issue

This commit is contained in:
Hongtao Zhang 2022-11-04 00:58:07 -05:00
parent 970fcd8f14
commit 569cc19001
No known key found for this signature in database
GPG key ID: 75F655B91C7AC9BB
6 changed files with 18 additions and 9 deletions

View file

@ -36,7 +36,10 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="EverythingSDK\*.dll">
<Content Update="EverythingSDK\x64\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="EverythingSDK\x86\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

View file

@ -67,7 +67,7 @@ namespace Flow.Launcher.Plugin.Explorer
SortOptionTranslationHelper.API = context.API;
EverythingApiDllImport.Load(Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "EverythingSDK",
Environment.Is64BitProcess ? "Everything64.dll" : "Everything86.dll"));
Environment.Is64BitProcess ? "x64" : "x86"));
return Task.CompletedTask;
}

View file

@ -1,5 +1,6 @@
using Flow.Launcher.Plugin.Everything.Everything;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
@ -9,14 +10,19 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
{
public static void Load(string path)
{
LoadLibrary(path);
int code = LoadLibrary(Path.Combine(path, DLL));
if (code == 0)
{
int err = Marshal.GetLastPInvokeError();
Marshal.ThrowExceptionForHR(err);
}
}
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
private static extern int LoadLibrary(string name);
private const string DLL = "Everything.dll";
[DllImport(DLL, CharSet = CharSet.Unicode)]
internal static extern int Everything_SetSearchW(string lpSearchString);
@ -150,4 +156,4 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
[DllImport(DLL)]
public static extern uint Everything_IncRunCountFromFileName(string lpFileName);
}
}
}

View file

@ -279,7 +279,7 @@
DockPanel.Dock="Top"
DragEnter="lbxAccessLinks_DragEnter"
Drop="LbxExcludedPaths_OnDrop"
ItemTemplate="{StaticResource ListViewActionKeywords}"
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}"
ItemsSource="{Binding Settings.IndexSearchExcludedSubdirectoryPaths}"
SelectedItem="{Binding SelectedIndexSearchExcludedPath}" />
<StackPanel HorizontalAlignment="Right"