use bitflags::bitflags;
use windows::core::{s, w};
use windows::Win32::UI::WindowsAndMessaging::WM_USER;
pub const EVERYTHING_WM_IPC: u32 = WM_USER;
pub const EVERYTHING_IPC_ALL_RESULTS: u32 = 0xFFFFFFFF;
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum IpcTargetMachine {
X86 = 1,
X64 = 2,
ARM = 3,
ARM64 = 4,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum IpcFilter {
Everything = 0,
Audio = 1,
Compressed = 2,
Document = 3,
Executable = 4,
Folder = 5,
Picture = 6,
Video = 7,
Custom = 8,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum TaskbarIpcCommand {
GetMajorVersion = 0,
GetMinorVersion = 1,
GetRevision = 2,
GetBuildNumber = 3,
Exit = 4,
GetTargetMachine = 5,
DeleteStartMenuShortcuts = 100,
DeleteQuickLaunchShortcut = 101,
DeleteDesktopShortcut = 102,
DeleteFolderContextMenu = 103,
DeleteRunOnSystemStartup = 104,
DeleteUrlProtocol = 105,
CreateStartMenuShortcuts = 200,
CreateQuickLaunchShortcut = 201,
CreateDesktopShortcut = 202,
CreateFolderContextMenu = 203,
CreateRunOnSystemStartup = 204,
CreateUrlProtocol = 205,
IsStartMenuShortcuts = 300,
IsQuickLaunchShortcut = 301,
IsDesktopShortcut = 302,
IsFolderContextMenu = 303,
IsRunOnSystemStartup = 304,
IsUrlProtocol = 305,
IsService = 306,
IsNtfsDriveIndexed = 400,
IsDbLoaded = 401,
IsDbBusy = 402,
IsAdmin = 403,
IsAppdata = 404,
RebuildDb = 405,
UpdateAllFolderIndexes = 406,
SaveDb = 407,
SaveRunHistory = 408,
DeleteRunHistory = 409,
IsFastSort = 410,
IsFileInfoIndexed = 411,
QueueRebuildDb = 412,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum SearchWindowIpcQuery {
IsMatchCase = 500,
IsMatchWholeWord = 501,
IsMatchPath = 502,
IsMatchDiacritics = 503,
IsRegex = 504,
IsFilters = 505,
IsPreview = 506,
IsStatusBar = 507,
IsDetails = 508,
GetThumbnailSize = 509,
GetSort = 510,
GetOnTop = 511,
GetFilter = 512,
GetFIlterIndex = 513,
IsMatchPrefix = 514,
IsMatchSuffix = 515,
IsIgnorePunctuation = 516,
IsIgnoreWhitespace = 517,
IsSearchAsYouType = 518,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum SearchWindowIpcCommand {
FileMenu = 10001,
EditMenu = 10002,
SearchMenu = 10003,
ToolsMenu = 10004,
HelpMenu = 10005,
Toolbar = 10006,
SearchEdit = 10007,
Filter = 10008,
ResultsHeader = 10009,
Status = 10010,
ViewZoomMenu = 10012,
ViewMenu = 10013,
ViewWindowSizeMenu = 10019,
ResultList = 10020,
BookmarksMenu = 10021,
ViewSortByMenu = 10022,
ViewGotoMenu = 10024,
ViewOntopMenu = 10025,
Preview = 10026,
TrayNewSearchWindow = 40001,
TrayConnectToEtpServer = 40004,
TrayOptions = 40005,
TrayExit = 40006,
TrayShowSearchWindow = 40007,
TrayToggleSearchWindow = 40008,
FileNewWindow = 40010,
FileClose = 40011,
FileExport = 40012,
FileExit = 40013,
FileOpenFilelist = 40014,
FileCloseFilelist = 40015,
EditCut = 40020,
EditCopy = 40021,
EditPaste = 40022,
EditSelectAll = 40023,
EditInvertSelection = 40029,
ViewZoomIn = 40030,
ViewZoomOut = 40031,
ViewZoomReset = 40032,
ViewToggleFullscreen = 40034,
ViewAutoFit = 40044,
ViewAutoSize1 = 40045,
ViewAutoSize2 = 40046,
ViewAutoSize3 = 40047,
ViewRefresh = 40036,
ViewFilters = 40035,
ViewSortByAscending = 40037,
ViewSortByDescending = 40038,
ViewStatusBar = 40039,
ViewGotoBack = 40040,
ViewGotoForward = 40041,
ViewOntopNever = 40042,
ViewOntopAlways = 40043,
ViewOntopWhileSearching = 40048,
ViewGotoHome = 40049,
ViewToggleLtrRtl = 40050,
ViewDetails = 40051,
ViewMediumIcons = 40052,
ViewLargeIcons = 40053,
ViewExtraLargeIcons = 40054,
ViewPreview = 40055,
ViewGotoShowAllHistory = 40056,
ViewIncreaseThumbnailSize = 40057,
ViewDecreaseThumbnailSize = 40058,
ViewShowFilters = 40096, ViewHideFilters = 40097, ViewShowPreview = 40098, ViewHidePreview = 40099, ViewShowStatusBar = 40100, ViewHideStatusBar = 40101, ViewDetailsNoToggle = 40102, ViewMediumIconsNoToggle = 40103, ViewLargeIconsNoToggle = 40104, ViewExtraLargeIconsNoToggle = 40105,
SearchToggleMatchCase = 40060,
SearchToggleMatchWholeWord = 40061,
SearchToggleMatchPath = 40062,
SearchToggleRegex = 40063,
SearchToggleMatchDiacritics = 40066,
SearchFilterAdd = 40067,
SearchFilterOrganize = 40068,
SearchAdvancedSearch = 40069,
SearchEnableMatchCase = 40106, SearchEnableMatchWholeWord = 40107, SearchEnableMatchPath = 40108, SearchEnableRegex = 40109, SearchEnableMatchDiacritics = 40110, SearchDisableMatchCase = 40111, SearchDisableMatchWholeWord = 40112, SearchDisableMatchPath = 40113, SearchDisableRegex = 40114, SearchDisableMatchDiacritics = 40115, SearchFilterEverything = 40116, SearchFilterAudio = 40117, SearchFilterCompressed = 40118, SearchFilterDocument = 40119, SearchFilterExecutable = 40120, SearchFilterFolder = 40121, SearchFilterPicture = 40122, SearchFilterVideo = 40123, SearchFilterAudioNoToggle = 40124, SearchFilterCompressedNoToggle = 40125, SearchFilterDocumentNoToggle = 40126, SearchFilterExecutableNoToggle = 40127, SearchFilterFolderNoToggle = 40128, SearchFilterPictureNoToggle = 40129, SearchFilterVideoNoToggle = 40130,
ToolsConnectToEtpServer = 40072,
ToolsDisconnectFromEtpServer = 40073,
ToolsOptions = 40074,
ToolsConsole = 40075,
ToolsEditor = 40076,
HelpViewHelpTopics = 40080,
HelpOpenEverythingWebsite = 40081,
HelpCheckForUpdates = 40082,
HelpAboutEverything = 40083,
HelpSearchSyntax = 40084,
HelpCommandLineOptions = 40085,
HelpRegexSyntax = 40086,
HelpDonate = 40087,
BookmarkAdd = 40090,
BookmarkOrganize = 40091,
FileOpen = 41000,
FileOpenNew = 41048,
FileOpenWith = 41049,
FileEdit = 41050,
FilePlay = 41051,
FilePrint = 41052,
FilePreview = 41053,
FilePrintTo = 41054,
FileRunAs = 41055,
FileOpenWithDefaultVerb = 41056,
FileOpenAndClose = 41057,
FileExplorePath = 41002,
FileOpenPath = 41003,
FileDelete = 41004,
FilePermanentlyDelete = 41005,
FileRename = 41006,
FileCopyFullPathAndName = 41007,
FileCopyPath = 41008,
FileProperties = 41009,
FileReadExtendedInformation = 41064,
FileCreateShortcut = 41065,
FileSetRunCount = 41068,
FileCopyName = 41011,
FileOpenAndDoNotClose = 41076,
ResultListExplore = 41001,
ResultListFocus = 41010,
ResultListAutofitColumns = 41012,
ResultListDown = 41018,
ResultListUp = 41019,
ResultListPageUp = 41020,
ResultListPageDown = 41021,
ResultListStart = 41022,
ResultListEnd = 41023,
ResultListDownExtend = 41024,
ResultListUpExtend = 41025,
ResultListPageUpExtend = 41026,
ResultListPageDownExtend = 41027,
ResultListStartExtend = 41028,
ResultListEndExtend = 41029,
ResultListFocusDown = 41030,
ResultListFocusUp = 41031,
ResultListFocusPageUp = 41032,
ResultListFocusPageDown = 41033,
ResultListFocusStart = 41034,
ResultListFocusEnd = 41035,
ResultListScrollLeft = 41036,
ResultListScrollRight = 41037,
ResultListScrollPageLeft = 41038,
ResultListScrollPageRight = 41039,
ResultListSelectFocus = 41040,
ResultListToggleFocusSelection = 41041,
ResultListContextMenu = 41046,
ResultListFocusDownExtend = 41058,
ResultListFocusUpExtend = 41059,
ResultListFocusPageUpExtend = 41060,
ResultListFocusPageDownExtend = 41061,
ResultListFocusStartExtend = 41062,
ResultListFocusEndExtend = 41063,
ResultListAutofit = 41066,
ResultListCopyCsv = 41067,
ResultListLeftExtend = 41070,
ResultListRightExtend = 41071,
ResultListFocusLeftExtend = 41072,
ResultListFocusRightExtend = 41073,
ResultListFocusMostRun = 41074,
ResultListFocusLastRun = 41075,
ResultListLeft = 41079, ResultListRight = 41080, ResultListFocusLeft = 41081, ResultListFocusRight = 41082, ResultListScrollLeftScrollOnly = 41083, ResultListScrollRightScrollOnly = 41084, ResultListScrollPageLeftScrollOnly = 41085, ResultListScrollPageRightScrollOnly = 41086,
ResultListSortByName = 41300,
ResultListSortByPath = 41301,
ResultListSortBySize = 41302,
ResultListSortByExtension = 41303,
ResultListSortByType = 41304,
ResultListSortByDateModified = 41305,
ResultListSortByDateCreated = 41306,
ResultListSortByAttributes = 41307,
ResultListSortByFileListFilename = 41308,
ResultListSortByRunCount = 41309,
ResultListSortByDateRecentlyChanged = 41310,
ResultListSortByDateAccessed = 41311,
ResultListSortByDateRun = 41312,
ResultListToggleNameColumn = 41400,
ResultListTogglePathColumn = 41401,
ResultListToggleSizeColumn = 41402,
ResultListToggleExtensionColumn = 41403,
ResultListToggleTypeColumn = 41404,
ResultListToggleDateModifiedColumn = 41405,
ResultListToggleDateCreatedColumn = 41406,
ResultListToggleAttributesColumn = 41407,
ResultListToggleFileListFilenameColumn = 41408,
ResultListToggleRunCountColumn = 41409,
ResultListToggleDateRecentlyChangedColumn = 41410,
ResultListToggleDateAccessedColumn = 41411,
ResultListToggleDateRunColumn = 41412,
ResultListSizeNameColumnToFit = 41600,
ResultListSizePathColumnToFit = 41601,
ResultListSizeSizeColumnToFit = 41602,
ResultListSizeExtensionColumnToFit = 41603,
ResultListSizeTypeColumnToFit = 41604,
ResultListSizeDateModifiedColumnToFit = 41605,
ResultListSizeDateCreatedColumnToFit = 41606,
ResultListSizeAttributesColumnToFit = 41607,
ResultListSizeFileListFilenameColumnToFit = 41608,
ResultListSizeRunCountColumnToFit = 41609,
ResultListSizeDateRecentlyChangedColumnToFit = 41610,
ResultListSizeDateAccessedColumnToFit = 41611,
ResultListSizeDateRunColumnToFit = 41612,
FileCustomVerb01 = 41500,
FileCustomVerb02 = 41501,
FileCustomVerb03 = 41502,
FileCustomVerb04 = 41503,
FileCustomVerb05 = 41504,
FileCustomVerb06 = 41505,
FileCustomVerb07 = 41506,
FileCustomVerb08 = 41507,
FileCustomVerb09 = 41508,
FileCustomVerb10 = 41509,
FileCustomVerb11 = 41510,
FileCustomVerb12 = 41511,
SearchEditFocus = 42000,
SearchEditWordDeleteToStart = 42019,
SearchEditAutoComplete = 42020,
SearchEditShowSearchHistory = 42021,
SearchEditShowAllSearchHistory = 42022,
TrayEditor = 41700,
TrayOpenFilelist = 41701,
IndexUpdateAllFoldersNow = 41800,
IndexForceRebuild = 41801,
}
pub const EVERYTHING_IPC_WNDCLASSW: windows::core::PCWSTR = w!("EVERYTHING_TASKBAR_NOTIFICATION");
pub const EVERYTHING_IPC_WNDCLASSA: windows::core::PCSTR = s!("EVERYTHING_TASKBAR_NOTIFICATION");
pub const EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSW: windows::core::PCWSTR = w!("EVERYTHING");
pub const EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSA: windows::core::PCSTR = s!("EVERYTHING");
pub const EVERYTHING_IPC_CREATEDW: windows::core::PCWSTR = w!("EVERYTHING_IPC_CREATED");
pub const EVERYTHING_IPC_CREATEDA: windows::core::PCSTR = s!("EVERYTHING_IPC_CREATED");
bitflags! {
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Default)]
pub struct IpcSearchFlags: u32 {
const MATCH_CASE = 0x00000001;
const MATCH_WHOLEWORD = 0x00000002;
const MATCH_PATH = 0x00000004;
const REGEX = 0x00000008;
const MATCH_ACCENTS = 0x00000010;
const MATCH_DIACRITICS = 0x00000010;
const MATCH_PREFIX = 0x00000020; const MATCH_SUFFIX = 0x00000040; const IGNORE_PUNCTUATION = 0x00000080;
const IGNORE_WHITESPACE = 0x00000100;
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Default)]
pub struct IpcItemFlags: u32 {
const IS_FOLDER = 0x00000001;
const IS_DRIVE_OR_ROOT = 0x00000002;
}
}
#[repr(C)]
pub struct IpcCommandLine {
pub show_command: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcQuery {
pub reply_hwnd: u32,
pub reply_copydata_message: u32,
pub search_flags: u32,
pub offset: u32,
pub max_results: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcQuery2 {
pub reply_hwnd: u32,
pub reply_copydata_message: u32,
pub search_flags: u32,
pub offset: u32,
pub max_results: u32,
pub request_flags: u32,
pub sort_type: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcItem {
pub flags: u32,
pub filename_offset: u32,
pub path_offset: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcList {
pub totfolders: u32,
pub totfiles: u32,
pub totitems: u32,
pub numfolders: u32,
pub numfiles: u32,
pub numitems: u32,
pub offset: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcItem2 {
pub flags: u32,
pub data_offset: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcList2 {
pub totitems: u32,
pub numitems: u32,
pub offset: u32,
pub request_flags: u32,
pub sort_type: u32,
}
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcRunHistory {
pub run_count: u32,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum IpcCopyData {
CommandLineUTF8 = 0,
QueryA = 1,
QueryW = 2,
Query2A = 17,
Query2W = 18,
GetRunCountA = 19,
GetRunCountW = 20,
SetRunCountA = 21,
SetRunCountW = 22,
IncRunCountA = 23,
IncRunCountW = 24,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Default)]
pub enum IpcSort {
#[default]
Default = 0,
NameAscending = 1,
NameDescending = 2,
PathAscending = 3,
PathDescending = 4,
SizeAscending = 5,
SizeDescending = 6,
ExtensionAscending = 7,
ExtensionDescending = 8,
TypeNameAscending = 9,
TypeNameDescending = 10,
DateCreatedAscending = 11,
DateCreatedDescending = 12,
DateModifiedAscending = 13,
DateModifiedDescending = 14,
AttributesAscending = 15,
AttributesDescending = 16,
FileListFilenameAscending = 17,
FileListFilenameDescending = 18,
RunCountAscending = 19,
RunCountDescending = 20,
DateRecentlyChangedAscending = 21,
DateRecentlyChangedDescending = 22,
DateAccessedAscending = 23,
DateAccessedDescending = 24,
DateRunAscending = 25,
DateRunDescending = 26,
}
pub const IPC_SORT_MAX: IpcSort = IpcSort::DateRunDescending;
bitflags! {
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Default)]
pub struct Query2RequestFlags: u32 {
const NAME = 0x00000001;
const PATH = 0x00000002;
const FULL_PATH_AND_NAME = 0x00000004;
const EXTENSION = 0x00000008;
const SIZE = 0x00000010;
const DATE_CREATED = 0x00000020;
const DATE_MODIFIED = 0x00000040;
const DATE_ACCESSED = 0x00000080;
const ATTRIBUTES = 0x00000100;
const FILE_LIST_FILE_NAME = 0x00000200;
const RUN_COUNT = 0x00000400;
const DATE_RUN = 0x00000800;
const DATE_RECENTLY_CHANGED = 0x00001000;
const HIGHLIGHTED_NAME = 0x00002000;
const HIGHLIGHTED_PATH = 0x00004000;
const HIGHLIGHTED_FULL_PATH_AND_NAME = 0x00008000;
}
}
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum IpcFileInfo {
FileSize = 1,
FolderSize = 2,
DateCreated = 3,
DateModified = 4,
DateAccessed = 5,
Attributes = 6,
}