Use existing Everything, dll is loaded by platform

fix #574
This commit is contained in:
bao-qian
2016-05-04 02:26:19 +01:00
parent 461e650e05
commit bc0f5a9136
21 changed files with 85 additions and 2783 deletions

View File

@@ -9,69 +9,68 @@ namespace Wox.Plugin.Everything.Everything
public sealed class EverythingAPI public sealed class EverythingAPI
{ {
#region DllImport #region DllImport
[DllImport(EVERYTHING_DLL_NAME, CharSet = CharSet.Unicode)] [DllImport(Main.DLL, CharSet = CharSet.Unicode)]
private static extern int Everything_SetSearchW(string lpSearchString); private static extern int Everything_SetSearchW(string lpSearchString);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SetMatchPath(bool bEnable); private static extern void Everything_SetMatchPath(bool bEnable);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SetMatchCase(bool bEnable); private static extern void Everything_SetMatchCase(bool bEnable);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SetMatchWholeWord(bool bEnable); private static extern void Everything_SetMatchWholeWord(bool bEnable);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SetRegex(bool bEnable); private static extern void Everything_SetRegex(bool bEnable);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SetMax(int dwMax); private static extern void Everything_SetMax(int dwMax);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SetOffset(int dwOffset); private static extern void Everything_SetOffset(int dwOffset);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_GetMatchPath(); private static extern bool Everything_GetMatchPath();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_GetMatchCase(); private static extern bool Everything_GetMatchCase();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_GetMatchWholeWord(); private static extern bool Everything_GetMatchWholeWord();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_GetRegex(); private static extern bool Everything_GetRegex();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern UInt32 Everything_GetMax(); private static extern UInt32 Everything_GetMax();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern UInt32 Everything_GetOffset(); private static extern UInt32 Everything_GetOffset();
[DllImport(EVERYTHING_DLL_NAME, CharSet = CharSet.Unicode)] [DllImport(Main.DLL, CharSet = CharSet.Unicode)]
private static extern string Everything_GetSearchW(); private static extern string Everything_GetSearchW();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern StateCode Everything_GetLastError(); private static extern StateCode Everything_GetLastError();
[DllImport(EVERYTHING_DLL_NAME, CharSet = CharSet.Unicode)] [DllImport(Main.DLL, CharSet = CharSet.Unicode)]
private static extern bool Everything_QueryW(bool bWait); private static extern bool Everything_QueryW(bool bWait);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_SortResultsByPath(); private static extern void Everything_SortResultsByPath();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern int Everything_GetNumFileResults(); private static extern int Everything_GetNumFileResults();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern int Everything_GetNumFolderResults(); private static extern int Everything_GetNumFolderResults();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern int Everything_GetNumResults(); private static extern int Everything_GetNumResults();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern int Everything_GetTotFileResults(); private static extern int Everything_GetTotFileResults();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern int Everything_GetTotFolderResults(); private static extern int Everything_GetTotFolderResults();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern int Everything_GetTotResults(); private static extern int Everything_GetTotResults();
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_IsVolumeResult(int nIndex); private static extern bool Everything_IsVolumeResult(int nIndex);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_IsFolderResult(int nIndex); private static extern bool Everything_IsFolderResult(int nIndex);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern bool Everything_IsFileResult(int nIndex); private static extern bool Everything_IsFileResult(int nIndex);
[DllImport(EVERYTHING_DLL_NAME, CharSet = CharSet.Unicode)] [DllImport(Main.DLL, CharSet = CharSet.Unicode)]
private static extern void Everything_GetResultFullPathNameW(int nIndex, StringBuilder lpString, int nMaxCount); private static extern void Everything_GetResultFullPathNameW(int nIndex, StringBuilder lpString, int nMaxCount);
[DllImport(EVERYTHING_DLL_NAME)] [DllImport(Main.DLL)]
private static extern void Everything_Reset(); private static extern void Everything_Reset();
#endregion #endregion
const string EVERYTHING_DLL_NAME = "Everything.dll";
enum StateCode enum StateCode
{ {
OK, OK,

View File

@@ -5,10 +5,8 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Windows; using System.Windows;
using Wox.Infrastructure.Storage; using Wox.Infrastructure.Storage;
using Wox.Infrastructure;
using Wox.Plugin.Everything.Everything; using Wox.Plugin.Everything.Everything;
namespace Wox.Plugin.Everything namespace Wox.Plugin.Everything
@@ -17,20 +15,14 @@ namespace Wox.Plugin.Everything
{ {
private readonly EverythingAPI _api = new EverythingAPI(); private readonly EverythingAPI _api = new EverythingAPI();
private const string EverythingProcessName = "Everything"; public const string SDK = "EverythingSDK";
private const string PortableEverything = "PortableEverything"; public const string DLL = "Everything.dll";
internal static string LibraryPath; internal static string SDKPath;
private PluginInitContext _context; private PluginInitContext _context;
private readonly Settings _settings; private Settings _settings;
private readonly PluginJsonStorage<Settings> _storage; private PluginJsonStorage<Settings> _storage;
public Main()
{
_storage = new PluginJsonStorage<Settings>();
_settings = _storage.Load();
}
public void Save() public void Save()
{ {
@@ -48,21 +40,6 @@ namespace Wox.Plugin.Everything
_settings.MaxSearchCount = 50; _settings.MaxSearchCount = 50;
} }
if (keyword == "uninstalleverything")
{
Result r = new Result();
r.Title = "Uninstall Everything";
r.SubTitle = "You need to uninstall everything service if you can not move/delete wox folder";
r.IcoPath = "Images\\find.png";
r.Action = c =>
{
UnInstallEverything();
return true;
};
r.Score = 2000;
results.Add(r);
}
try try
{ {
var searchList = _api.Search(keyword, maxCount: _settings.MaxSearchCount).ToList(); var searchList = _api.Search(keyword, maxCount: _settings.MaxSearchCount).ToList();
@@ -100,7 +77,6 @@ namespace Wox.Plugin.Everything
} }
catch (IPCErrorException) catch (IPCErrorException)
{ {
StartEverything();
results.Add(new Result results.Add(new Result
{ {
Title = _context.API.GetTranslation("wox_plugin_everything_is_not_running"), Title = _context.API.GetTranslation("wox_plugin_everything_is_not_running"),
@@ -150,14 +126,35 @@ namespace Wox.Plugin.Everything
public void Init(PluginInitContext context) public void Init(PluginInitContext context)
{ {
_context = context; _context = context;
_storage = new PluginJsonStorage<Settings>();
_settings = _storage.Load();
var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory;
var libraryDirectory = Path.Combine(pluginDirectory, PortableEverything, CpuType()); var bundledSDKDirectory = Path.Combine(pluginDirectory, SDK, CpuType());
LibraryPath = Path.Combine(libraryDirectory, "Everything.dll"); var bundledSDKPath = Path.Combine(bundledSDKDirectory, DLL);
LoadLibrary(LibraryPath);
//Helper.AddDLLDirectory(libraryDirectory);
StartEverything(); var SDKDirectory = Path.Combine(_storage.DirectoryPath, SDK, CpuType());
SDKPath = Path.Combine(SDKDirectory, DLL);
if (!Directory.Exists(SDKDirectory))
{
Directory.CreateDirectory(SDKDirectory);
}
if (!File.Exists(SDKPath))
{
File.Copy(bundledSDKPath, SDKPath);
}
else
{
var newSDK = new FileInfo(bundledSDKPath).LastWriteTimeUtc;
var oldSDK = new FileInfo(SDKPath).LastWriteTimeUtc;
if (oldSDK != newSDK)
{
File.Copy(bundledSDKPath, SDKPath, true);
}
}
LoadLibrary(SDKPath);
} }
private string CpuType() private string CpuType()
@@ -165,112 +162,6 @@ namespace Wox.Plugin.Everything
return Environment.Is64BitOperatingSystem ? "x64" : "x86"; return Environment.Is64BitOperatingSystem ? "x64" : "x86";
} }
private void StartEverything()
{
if (!CheckEverythingServiceRunning())
{
if (InstallAndRunEverythingService())
{
StartEverythingClient();
}
}
else
{
StartEverythingClient();
}
}
private bool InstallAndRunEverythingService()
{
try
{
Process p = new Process();
p.StartInfo.Verb = "runas";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.FileName = GetEverythingPath();
p.StartInfo.UseShellExecute = true;
p.StartInfo.Arguments = "-install-service";
p.Start();
return true;
}
catch (Exception e)
{
return false;
}
}
private bool UnInstallEverything()
{
try
{
Process p = new Process();
p.StartInfo.Verb = "runas";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.FileName = GetEverythingPath();
p.StartInfo.UseShellExecute = true;
p.StartInfo.Arguments = "-uninstall-service";
p.Start();
Process[] proc = Process.GetProcessesByName(EverythingProcessName);
foreach (Process process in proc)
{
process.Kill();
}
return true;
}
catch (Exception e)
{
return false;
}
}
private void StartEverythingClient()
{
try
{
Process p = new Process();
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.FileName = GetEverythingPath();
p.StartInfo.UseShellExecute = true;
p.StartInfo.Arguments = "-startup";
p.Start();
}
catch (Exception e)
{
_context.API.ShowMsg("Start Everything failed");
}
}
private bool CheckEverythingServiceRunning()
{
try
{
ServiceController sc = new ServiceController(EverythingProcessName);
return sc.Status == ServiceControllerStatus.Running;
}
catch
{
}
return false;
}
private bool CheckEverythingIsRunning()
{
return Process.GetProcessesByName(EverythingProcessName).Length > 0;
}
private string GetEverythingPath()
{
string directory = Path.Combine(
_context.CurrentPluginMetadata.PluginDirectory,
PortableEverything, CpuType(),
"Everything.exe"
);
return directory;
}
public string GetTranslatedPluginTitle() public string GetTranslatedPluginTitle()
{ {
return _context.API.GetTranslation("wox_plugin_everything_plugin_name"); return _context.API.GetTranslation("wox_plugin_everything_plugin_name");

View File

@@ -71,6 +71,12 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="EverythingSDK\x64\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="EverythingSDK\x86\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\error.png"> <Content Include="Images\error.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@@ -89,18 +95,6 @@
<Content Include="Images\warning.png"> <Content Include="Images\warning.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="PortableEverything\x64\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="PortableEverything\x64\Everything.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="PortableEverything\x86\Everything.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="PortableEverything\x86\Everything.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

File diff suppressed because it is too large Load Diff

View File

@@ -1,51 +0,0 @@
LIBRARY Everything
EXPORTS
Everything_GetLastError
Everything_SetSearchA
Everything_SetSearchW
Everything_SetMatchPath
Everything_SetMatchCase
Everything_SetMatchWholeWord
Everything_SetRegex
Everything_SetMax
Everything_SetOffset
Everything_GetSearchA
Everything_GetSearchW
Everything_GetMatchPath
Everything_GetMatchCase
Everything_GetMatchWholeWord
Everything_GetRegex
Everything_GetMax
Everything_GetOffset
Everything_QueryA
Everything_QueryW
Everything_IsQueryReply
Everything_SortResultsByPath
Everything_GetNumFileResults
Everything_GetNumFolderResults
Everything_GetNumResults
Everything_GetTotFileResults
Everything_GetTotFolderResults
Everything_GetTotResults
Everything_IsVolumeResult
Everything_IsFolderResult
Everything_IsFileResult
Everything_GetResultFileNameA
Everything_GetResultFileNameW
Everything_GetResultPathA
Everything_GetResultPathW
Everything_GetResultFullPathNameA
Everything_GetResultFullPathNameW
Everything_Reset

View File

@@ -1,95 +0,0 @@
#ifndef _EVERYTHING_DLL_
#define _EVERYTHING_DLL_
#ifndef _INC_WINDOWS
#include <windows.h>
#endif
#define EVERYTHING_OK 0
#define EVERYTHING_ERROR_MEMORY 1
#define EVERYTHING_ERROR_IPC 2
#define EVERYTHING_ERROR_REGISTERCLASSEX 3
#define EVERYTHING_ERROR_CREATEWINDOW 4
#define EVERYTHING_ERROR_CREATETHREAD 5
#define EVERYTHING_ERROR_INVALIDINDEX 6
#define EVERYTHING_ERROR_INVALIDCALL 7
#ifndef EVERYTHINGAPI
#define EVERYTHINGAPI __stdcall
#endif
#ifndef EVERYTHINGUSERAPI
#define EVERYTHINGUSERAPI __declspec(dllimport)
#endif
// write search state
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetRegex(BOOL bEnable);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMax(DWORD dwMax);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd);
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetReplyID(DWORD nId);
// read search state
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchPath(VOID);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchCase(VOID);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(VOID);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetRegex(VOID);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMax(VOID);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetOffset(VOID);
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetSearchA(VOID);
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetSearchW(VOID);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetLastError(VOID);
EVERYTHINGUSERAPI HWND EVERYTHINGAPI Everything_GetReplyWindow(VOID);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetReplyID(VOID);
// execute query
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait);
// query reply
BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD nId);
// write result state
EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SortResultsByPath(VOID);
// read result state
EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetNumFileResults(VOID);
EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetNumFolderResults(VOID);
EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetNumResults(VOID);
EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetTotFileResults(VOID);
EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetTotFolderResults(VOID);
EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetTotResults(VOID);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsVolumeResult(int nIndex);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFolderResult(int nIndex);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFileResult(int nIndex);
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(int nIndex);
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(int nIndex);
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(int nIndex);
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultPathA(int nIndex);
EVERYTHINGUSERAPI int Everything_GetResultFullPathNameW(int nIndex,LPWSTR wbuf,int wbuf_size_in_wchars);
EVERYTHINGUSERAPI int Everything_GetResultFullPathNameA(int nIndex,LPSTR buf,int bufsize);
EVERYTHINGUSERAPI VOID Everything_Reset(VOID);
#ifdef UNICODE
#define Everything_SetSearch Everything_SetSearchW
#define Everything_GetSearch Everything_GetSearchW
#define Everything_Query Everything_QueryW
#define Everything_GetResultFileName Everything_GetResultFileNameW
#define Everything_GetResultPath Everything_GetResultPathW
#else
#define Everything_SetSearch Everything_SetSearchA
#define Everything_GetSearch Everything_GetSearchA
#define Everything_Query Everything_QueryA
#define Everything_GetResultFileName Everything_GetResultFileNameA
#define Everything_GetResultPath Everything_GetResultPathA
#endif
#endif

View File

@@ -1,287 +0,0 @@
// Everything IPC
#ifndef _EVERYTHING_IPC_H_
#define _EVERYTHING_IPC_H_
// C
#ifdef __cplusplus
extern "C" {
#endif
// 1 byte packing for our varible sized structs
#pragma pack(push, 1)
// WM_USER (send to the taskbar notification window)
// SendMessage(FindWindow(EVERYTHING_IPC_WNDCLASS,0),WM_USER,EVERYTHING_IPC_*,lParam)
// version format: major.minor.revision.build
// example: 1.1.4.309
#define EVERYTHING_IPC_GET_MAJOR_VERSION 0 // int major_version = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_MAJOR_VERSION,0);
#define EVERYTHING_IPC_GET_MINOR_VERSION 1 // int minor_version = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_MINOR_VERSION,0);
#define EVERYTHING_IPC_GET_REVISION 2 // int revision = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_REVISION,0);
#define EVERYTHING_IPC_GET_BUILD_NUMBER 3 // int build = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_BUILD,0);
// uninstall options
#define EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS 100 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT 101 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT 102 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU 103 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP 104 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP,0);
// install options
#define EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS 200 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT 201 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT 202 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU 203 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP 204 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP,0);
// get option status; 0 = no, 1 = yes, 2 = indeterminate (partially installed)
#define EVERYTHING_IPC_IS_START_MENU_SHORTCUTS 300 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT 301 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_IS_DESKTOP_SHORTCUT 302 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU 303 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP 304 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP,0);
// find the everything window
#define EVERYTHING_IPC_WNDCLASS TEXT("EVERYTHING_TASKBAR_NOTIFICATION")
// find a everything search window
#define EVERYTHING_IPC_SEARCH_WNDCLASS TEXT("EVERYTHING")
// this global window message is sent to all top level windows when everything starts.
#define EVERYTHING_IPC_CREATED TEXT("EVERYTHING_IPC_CREATED")
// search flags for querys
#define EVERYTHING_IPC_MATCHCASE 0x00000001 // match case
#define EVERYTHING_IPC_MATCHWHOLEWORD 0x00000002 // match whole word
#define EVERYTHING_IPC_MATCHPATH 0x00000004 // include paths in search
#define EVERYTHING_IPC_REGEX 0x00000008 // enable regex
// item flags
#define EVERYTHING_IPC_FOLDER 0x00000001 // The item is a folder. (its a file if not set)
#define EVERYTHING_IPC_DRIVE 0x00000002 // The folder is a drive. Path will be an empty string.
// (will also have the folder bit set)
// the WM_COPYDATA message for a query.
#define EVERYTHING_IPC_COPYDATAQUERYA 1
#define EVERYTHING_IPC_COPYDATAQUERYW 2
// all results
#define EVERYTHING_IPC_ALLRESULTS 0xFFFFFFFF // all results
// macro to get the filename of an item
#define EVERYTHING_IPC_ITEMFILENAMEA(list,item) (CHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMA *)(item))->filename_offset)
#define EVERYTHING_IPC_ITEMFILENAMEW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->filename_offset)
// macro to get the path of an item
#define EVERYTHING_IPC_ITEMPATHA(list,item) (CHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->path_offset)
#define EVERYTHING_IPC_ITEMPATHW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->path_offset)
//
// Varible sized query struct sent to everything.
//
// sent in the form of a WM_COPYDAYA message with EVERYTHING_IPC_COPYDATAQUERY as the
// dwData member in the COPYDATASTRUCT struct.
// set the lpData member of the COPYDATASTRUCT struct to point to your EVERYTHING_IPC_QUERY struct.
// set the cbData member of the COPYDATASTRUCT struct to the size of the
// EVERYTHING_IPC_QUERY struct minus the size of a CHAR plus the length of the search string in bytes plus
// one CHAR for the null terminator.
//
// NOTE: to determine the size of this structure use
// ASCII: sizeof(EVERYTHING_IPC_QUERYA) - sizeof(CHAR) + strlen(search_string)*sizeof(CHAR) + sizeof(CHAR)
// UNICODE: sizeof(EVERYTHING_IPC_QUERYW) - sizeof(WCHAR) + unicode_length_in_wchars(search_string)*sizeof(WCHAR) + sizeof(WCHAR)
//
// NOTE: Everything will only do one query per window.
// Sending another query when a query has not completed
// will cancel the old query and start the new one.
//
// Everything will send the results to the reply_hwnd in the form of a
// WM_COPYDAYA message with the dwData value you specify.
//
// Everything will return TRUE if successful.
// returns FALSE if not supported.
//
// If you query with EVERYTHING_IPC_COPYDATAQUERYW, the results sent from Everything will be Unicode.
//
typedef struct EVERYTHING_IPC_QUERYW
{
// the window that will receive the new results.
INT32 reply_hwnd;
// the value to set the dwData member in the COPYDATASTRUCT struct
// sent by Everything when the query is complete.
INT32 reply_copydata_message;
// search flags (see EVERYTHING_MATCHCASE | EVERYTHING_MATCHWHOLEWORD | EVERYTHING_MATCHPATH)
INT32 search_flags;
// only return results after 'offset' results (0 to return the first result)
// useful for scrollable lists
INT32 offset;
// the number of results to return
// zero to return no results
// EVERYTHING_IPC_ALLRESULTS to return ALL results
INT32 max_results;
// null terminated string. arbitrary sized search_string buffer.
INT32 search_string[1];
}EVERYTHING_IPC_QUERYW;
// ASCII version
typedef struct EVERYTHING_IPC_QUERYA
{
// the window that will receive the new results.
INT32 reply_hwnd;
// the value to set the dwData member in the COPYDATASTRUCT struct
// sent by Everything when the query is complete.
INT32 reply_copydata_message;
// search flags (see EVERYTHING_MATCHCASE | EVERYTHING_MATCHWHOLEWORD | EVERYTHING_MATCHPATH)
INT32 search_flags;
// only return results after 'offset' results (0 to return the first result)
// useful for scrollable lists
INT32 offset;
// the number of results to return
// zero to return no results
// EVERYTHING_IPC_ALLRESULTS to return ALL results
INT32 max_results;
// null terminated string. arbitrary sized search_string buffer.
INT32 search_string[1];
}EVERYTHING_IPC_QUERYA;
//
// Varible sized result list struct received from Everything.
//
// Sent in the form of a WM_COPYDATA message to the hwnd specifed in the
// EVERYTHING_IPC_QUERY struct.
// the dwData member of the COPYDATASTRUCT struct will match the sent
// reply_copydata_message member in the EVERYTHING_IPC_QUERY struct.
//
// make a copy of the data before returning.
//
// return TRUE if you processed the WM_COPYDATA message.
//
typedef struct EVERYTHING_IPC_ITEMW
{
// item flags
DWORD flags;
// The offset of the filename from the beginning of the list structure.
// (wchar_t *)((char *)everything_list + everythinglist->name_offset)
DWORD filename_offset;
// The offset of the filename from the beginning of the list structure.
// (wchar_t *)((char *)everything_list + everythinglist->path_offset)
DWORD path_offset;
}EVERYTHING_IPC_ITEMW;
typedef struct EVERYTHING_IPC_ITEMA
{
// item flags
DWORD flags;
// The offset of the filename from the beginning of the list structure.
// (char *)((char *)everything_list + everythinglist->name_offset)
DWORD filename_offset;
// The offset of the filename from the beginning of the list structure.
// (char *)((char *)everything_list + everythinglist->path_offset)
DWORD path_offset;
}EVERYTHING_IPC_ITEMA;
typedef struct EVERYTHING_IPC_LISTW
{
// the total number of folders found.
DWORD totfolders;
// the total number of files found.
DWORD totfiles;
// totfolders + totfiles
DWORD totitems;
// the number of folders available.
DWORD numfolders;
// the number of files available.
DWORD numfiles;
// the number of items available.
DWORD numitems;
// index offset of the first result in the item list.
DWORD offset;
// arbitrary sized item list.
// use numitems to determine the actual number of items available.
EVERYTHING_IPC_ITEMW items[1];
}EVERYTHING_IPC_LISTW;
typedef struct EVERYTHING_IPC_LISTA
{
// the total number of folders found.
DWORD totfolders;
// the total number of files found.
DWORD totfiles;
// totfolders + totfiles
DWORD totitems;
// the number of folders available.
DWORD numfolders;
// the number of files available.
DWORD numfiles;
// the number of items available.
DWORD numitems;
// index offset of the first result in the item list.
DWORD offset;
// arbitrary sized item list.
// use numitems to determine the actual number of items available.
EVERYTHING_IPC_ITEMA items[1];
}EVERYTHING_IPC_LISTA;
#ifdef UNICODE
#define EVERYTHING_IPC_COPYDATAQUERY EVERYTHING_IPC_COPYDATAQUERYW
#define EVERYTHING_IPC_ITEMFILENAME EVERYTHING_IPC_ITEMFILENAMEW
#define EVERYTHING_IPC_ITEMPATH EVERYTHING_IPC_ITEMPATHW
#define EVERYTHING_IPC_QUERY EVERYTHING_IPC_QUERYW
#define EVERYTHING_IPC_ITEM EVERYTHING_IPC_ITEMW
#define EVERYTHING_IPC_LIST EVERYTHING_IPC_LISTW
#else
#define EVERYTHING_IPC_COPYDATAQUERY EVERYTHING_IPC_COPYDATAQUERYA
#define EVERYTHING_IPC_ITEMFILENAME EVERYTHING_IPC_ITEMFILENAMEA
#define EVERYTHING_IPC_ITEMPATH EVERYTHING_IPC_ITEMPATHA
#define EVERYTHING_IPC_QUERY EVERYTHING_IPC_QUERYA
#define EVERYTHING_IPC_ITEM EVERYTHING_IPC_ITEMA
#define EVERYTHING_IPC_LIST EVERYTHING_IPC_LISTA
#endif
// restore packing
#pragma pack(pop)
// end extern C
#ifdef __cplusplus
}
#endif
#endif // _EVERYTHING_H_

View File

@@ -1,26 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll.vcxproj", "{7C90030E-6EDB-445E-A61B-5540B7355C59}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|Win32.ActiveCfg = Debug|x64
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|Win32.Build.0 = Debug|x64
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|x64.ActiveCfg = Debug|x64
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|x64.Build.0 = Debug|x64
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|Win32.ActiveCfg = Release|Win32
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|Win32.Build.0 = Release|Win32
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|x64.ActiveCfg = Release|x64
{7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,291 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7C90030E-6EDB-445E-A61B-5540B7355C59}</ProjectGuid>
<RootNamespace>dll</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v90</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v90</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v90</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v90</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</IgnoreImportLibrary>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
<IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</IgnoreImportLibrary>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BZ_NO_STDIO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)Everything.dll</OutputFile>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<SubSystem>Console</SubSystem>
<StackReserveSize>0</StackReserveSize>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>ComCtl32.lib;UxTheme.lib;Ws2_32.lib;shlwapi.lib;ole32.lib;htmlhelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)Everything.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)dll.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BZ_NO_STDIO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Link>
<ShowProgress>NotSet</ShowProgress>
<OutputFile>$(OutDir)Everything.dll</OutputFile>
<AdditionalManifestDependencies>%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<ModuleDefinitionFile>everything.def</ModuleDefinitionFile>
<GenerateDebugInformation>false</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<SubSystem>Windows</SubSystem>
<StackReserveSize>0</StackReserveSize>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>
</LinkTimeCodeGeneration>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
<SuppressStartupBanner>false</SuppressStartupBanner>
<VerboseOutput>false</VerboseOutput>
</Manifest>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Link>
<AdditionalDependencies>comctl32.lib;UxTheme.lib;Ws2_32.lib;HTMLHelp.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<OutputFile>$(OutDir)Everything.dll</OutputFile>
<AdditionalManifestDependencies>%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>
</LinkTimeCodeGeneration>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
<Manifest>
<AdditionalManifestFiles>%(AdditionalManifestFiles)</AdditionalManifestFiles>
<SuppressStartupBanner>false</SuppressStartupBanner>
<VerboseOutput>false</VerboseOutput>
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Everything.c" />
</ItemGroup>
<ItemGroup>
<None Include="Everything.def" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Everything.h" />
<ClInclude Include="Everything_IPC.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{072e536f-0b4e-4b52-bbf4-45486ca2a90b}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Everything.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="Everything.def">
<Filter>src</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Everything.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="Everything_IPC.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -64,25 +64,17 @@
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe" <NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe"</NMakeBuildCommandLine>
$(SolutionDir)Output\$(Configuration)\Plugins\Wox.Plugin.Everything\PortableEverything\$(PlatformTarget)\Everything.exe -stop-service
</NMakeBuildCommandLine>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe" <NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe"</NMakeBuildCommandLine>
$(SolutionDir)Output\$(Configuration)\Plugins\Wox.Plugin.Everything\PortableEverything\$(PlatformTarget)\Everything.exe -stop-service
</NMakeBuildCommandLine>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe" <NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe"</NMakeBuildCommandLine>
$(SolutionDir)Output\$(Configuration)\Plugins\Wox.Plugin.Everything\PortableEverything\$(PlatformTarget)\Everything.exe -stop-service
</NMakeBuildCommandLine>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe" <NMakeBuildCommandLine>taskkill /f /fi "IMAGENAME eq Wox.exe"</NMakeBuildCommandLine>
$(SolutionDir)Output\$(Configuration)\Plugins\Wox.Plugin.Everything\PortableEverything\$(PlatformTarget)\Everything.exe -stop-service
</NMakeBuildCommandLine>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
</ItemDefinitionGroup> </ItemDefinitionGroup>

View File

@@ -34,7 +34,7 @@ namespace Wox.Core.Plugin
return; return;
} }
string pluginFolerPath = PluginManager.UserDirectory; string pluginFolerPath = Infrastructure.Wox.UserDirectory;
string newPluginName = plugin.Name string newPluginName = plugin.Name
.Replace("/", "_") .Replace("/", "_")

View File

@@ -33,16 +33,13 @@ namespace Wox.Core.Plugin
private static IEnumerable<PluginPair> InstantQueryPlugins { get; set; } private static IEnumerable<PluginPair> InstantQueryPlugins { get; set; }
public static IPublicAPI API { private set; get; } public static IPublicAPI API { private set; get; }
public const string DirectoryName = "Plugins"; private static readonly string[] Directories = {Infrastructure.Wox.PreinstalledDirectory, Infrastructure.Wox.UserDirectory };
public static readonly string PreinstalledDirectory = Path.Combine(Infrastructure.Wox.ProgramPath, DirectoryName);
public static readonly string UserDirectory = Path.Combine(Infrastructure.Wox.DataPath, DirectoryName);
private static readonly string[] Directories = { PreinstalledDirectory, UserDirectory };
private static void ValidateUserDirectory() private static void ValidateUserDirectory()
{ {
if (!Directory.Exists(UserDirectory)) if (!Directory.Exists(Infrastructure.Wox.UserDirectory))
{ {
Directory.CreateDirectory(UserDirectory); Directory.CreateDirectory(Infrastructure.Wox.UserDirectory);
} }
} }

View File

@@ -34,7 +34,7 @@ namespace Wox.Core.Resource
internal static void UpdatePluginLanguages() internal static void UpdatePluginLanguages()
{ {
RemoveResource(PluginManager.DirectoryName); RemoveResource(Infrastructure.Wox.Plugins);
foreach (var plugin in PluginManager.GetPluginsForInterface<IPluginI18n>()) foreach (var plugin in PluginManager.GetPluginsForInterface<IPluginI18n>())
{ {
var location = Assembly.GetAssembly(plugin.Plugin.GetType()).Location; var location = Assembly.GetAssembly(plugin.Plugin.GetType()).Location;

View File

@@ -21,7 +21,7 @@ namespace Wox.Infrastructure.Image
private static readonly string DefaultIcon = Path.Combine(Wox.ProgramPath, "Images", "app.png"); private static readonly string DefaultIcon = Path.Combine(Wox.ProgramPath, "Images", "app.png");
private static readonly string ErrorIcon = Path.Combine(Wox.ProgramPath, "Images", "app_error.png"); private static readonly string ErrorIcon = Path.Combine(Wox.ProgramPath, "Images", "app_error.png");
private static readonly string[] ImageExtions = private static readonly string[] ImageExtions =
{ {
".png", ".png",
".jpg", ".jpg",
@@ -100,8 +100,12 @@ namespace Wox.Infrastructure.Image
} }
public static void PreloadImages() public static void PreloadImages()
{ {
ImageSources[DefaultIcon] = new BitmapImage(new Uri(DefaultIcon)); foreach (var icon in new[] { DefaultIcon, ErrorIcon })
ImageSources[ErrorIcon] = new BitmapImage(new Uri(ErrorIcon)); {
ImageSource img = new BitmapImage(new Uri(DefaultIcon));
img.Freeze();
ImageSources[icon] = img;
}
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
Stopwatch.Debug("Preload images from cache", () => Stopwatch.Debug("Preload images from cache", () =>

View File

@@ -6,7 +6,7 @@ namespace Wox.Infrastructure.Storage
{ {
public PluginJsonStorage() public PluginJsonStorage()
{ {
DirectoryName = "Plugins"; DirectoryName = Wox.Plugins;
// C# releated, add python releated below // C# releated, add python releated below
var assemblyName = DataType.Assembly.GetName().Name; var assemblyName = DataType.Assembly.GetName().Name;

View File

@@ -7,7 +7,10 @@ namespace Wox.Infrastructure
public static class Wox public static class Wox
{ {
public const string Name = "Wox"; public const string Name = "Wox";
public const string Plugins = "Plugins";
public static readonly string ProgramPath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString(); public static readonly string ProgramPath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString();
public static readonly string DataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Name); public static readonly string DataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Name);
public static readonly string UserDirectory = Path.Combine(DataPath, Plugins);
public static readonly string PreinstalledDirectory = Path.Combine(ProgramPath, Plugins);
} }
} }