everything-direct 0.1.0

Direct IPC bindings for Everything Search Engine on Windows.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
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 {
    // ret: i32
    GetMajorVersion = 0,
    GetMinorVersion = 1,
    GetRevision = 2,
    GetBuildNumber = 3,
    Exit = 4,
    GetTargetMachine = 5,

    // uninstall options
    DeleteStartMenuShortcuts = 100,
    DeleteQuickLaunchShortcut = 101,
    DeleteDesktopShortcut = 102,
    DeleteFolderContextMenu = 103,
    DeleteRunOnSystemStartup = 104,
    DeleteUrlProtocol = 105,

    // install options
    CreateStartMenuShortcuts = 200,
    CreateQuickLaunchShortcut = 201,
    CreateDesktopShortcut = 202,
    CreateFolderContextMenu = 203,
    CreateRunOnSystemStartup = 204,
    CreateUrlProtocol = 205,

    // get install option status
    IsStartMenuShortcuts = 300,
    IsQuickLaunchShortcut = 301,
    IsDesktopShortcut = 302,
    IsFolderContextMenu = 303,
    IsRunOnSystemStartup = 304,
    IsUrlProtocol = 305,
    IsService = 306,

    IsNtfsDriveIndexed = 400,

    // Everything 1.4
    IsDbLoaded = 401,
    IsDbBusy = 402,
    IsAdmin = 403,
    IsAppdata = 404,
    RebuildDb = 405,
    UpdateAllFolderIndexes = 406,
    SaveDb = 407,
    SaveRunHistory = 408,
    DeleteRunHistory = 409,
    IsFastSort = 410,
    IsFileInfoIndexed = 411,

    // Everything 1.5
    QueueRebuildDb = 412,
}

/// IPC commands for the Search Window
/// Requires Everything 1.4
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum SearchWindowIpcQuery {
    // ret: i32
    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,

    // Everything 1.5
    IsMatchPrefix = 514,
    IsMatchSuffix = 515,
    IsIgnorePunctuation = 516,
    IsIgnoreWhitespace = 517,
    IsSearchAsYouType = 518,
}

#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum SearchWindowIpcCommand {
    // main menus
    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,

    // TRAY
    TrayNewSearchWindow = 40001,
    TrayConnectToEtpServer = 40004,
    TrayOptions = 40005,
    TrayExit = 40006,
    TrayShowSearchWindow = 40007,
    TrayToggleSearchWindow = 40008,

    // FILE
    FileNewWindow = 40010,
    FileClose = 40011,
    FileExport = 40012,
    FileExit = 40013,
    FileOpenFilelist = 40014,
    FileCloseFilelist = 40015,

    // EDIT
    EditCut = 40020,
    EditCopy = 40021,
    EditPaste = 40022,
    EditSelectAll = 40023,
    EditInvertSelection = 40029,

    // VIEW
    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,             // Everything 1.4.1
    ViewHideFilters = 40097,             // Everything 1.4.1
    ViewShowPreview = 40098,             // Everything 1.4.1
    ViewHidePreview = 40099,             // Everything 1.4.1
    ViewShowStatusBar = 40100,           // Everything 1.4.1
    ViewHideStatusBar = 40101,           // Everything 1.4.1
    ViewDetailsNoToggle = 40102,         // Everything 1.4.1
    ViewMediumIconsNoToggle = 40103,     // Everything 1.4.1
    ViewLargeIconsNoToggle = 40104,      // Everything 1.4.1
    ViewExtraLargeIconsNoToggle = 40105, // Everything 1.4.1

    // SEARCH
    SearchToggleMatchCase = 40060,
    SearchToggleMatchWholeWord = 40061,
    SearchToggleMatchPath = 40062,
    SearchToggleRegex = 40063,
    SearchToggleMatchDiacritics = 40066,
    SearchFilterAdd = 40067,
    SearchFilterOrganize = 40068,
    SearchAdvancedSearch = 40069,
    SearchEnableMatchCase = 40106,          // Everything 1.4.1
    SearchEnableMatchWholeWord = 40107,     // Everything 1.4.1
    SearchEnableMatchPath = 40108,          // Everything 1.4.1
    SearchEnableRegex = 40109,              // Everything 1.4.1
    SearchEnableMatchDiacritics = 40110,    // Everything 1.4.1
    SearchDisableMatchCase = 40111,         // Everything 1.4.1
    SearchDisableMatchWholeWord = 40112,    // Everything 1.4.1
    SearchDisableMatchPath = 40113,         // Everything 1.4.1
    SearchDisableRegex = 40114,             // Everything 1.4.1
    SearchDisableMatchDiacritics = 40115,   // Everything 1.4.1
    SearchFilterEverything = 40116,         // Everything 1.4.1
    SearchFilterAudio = 40117,              // Everything 1.4.1
    SearchFilterCompressed = 40118,         // Everything 1.4.1
    SearchFilterDocument = 40119,           // Everything 1.4.1
    SearchFilterExecutable = 40120,         // Everything 1.4.1
    SearchFilterFolder = 40121,             // Everything 1.4.1
    SearchFilterPicture = 40122,            // Everything 1.4.1
    SearchFilterVideo = 40123,              // Everything 1.4.1
    SearchFilterAudioNoToggle = 40124,      // Everything 1.4.1
    SearchFilterCompressedNoToggle = 40125, // Everything 1.4.1
    SearchFilterDocumentNoToggle = 40126,   // Everything 1.4.1
    SearchFilterExecutableNoToggle = 40127, // Everything 1.4.1
    SearchFilterFolderNoToggle = 40128,     // Everything 1.4.1
    SearchFilterPictureNoToggle = 40129,    // Everything 1.4.1
    SearchFilterVideoNoToggle = 40130,      // Everything 1.4.1

    // TOOLS
    ToolsConnectToEtpServer = 40072,
    ToolsDisconnectFromEtpServer = 40073,
    ToolsOptions = 40074,
    ToolsConsole = 40075,
    ToolsEditor = 40076,

    // HELP
    HelpViewHelpTopics = 40080,
    HelpOpenEverythingWebsite = 40081,
    HelpCheckForUpdates = 40082,
    HelpAboutEverything = 40083,
    HelpSearchSyntax = 40084,
    HelpCommandLineOptions = 40085,
    HelpRegexSyntax = 40086,
    HelpDonate = 40087,

    // bookmarks
    BookmarkAdd = 40090,
    BookmarkOrganize = 40091,

    // files
    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,

    // result list
    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,                      // Everything 1.4.1
    ResultListRight = 41080,                     // Everything 1.4.1
    ResultListFocusLeft = 41081,                 // Everything 1.4.1
    ResultListFocusRight = 41082,                // Everything 1.4.1
    ResultListScrollLeftScrollOnly = 41083,      // Everything 1.4.1
    ResultListScrollRightScrollOnly = 41084,     // Everything 1.4.1
    ResultListScrollPageLeftScrollOnly = 41085,  // Everything 1.4.1
    ResultListScrollPageRightScrollOnly = 41086, // Everything 1.4.1

    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,

    // search
    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)]
    /// Flags controlling how a search is performed when sending queries via IPC.
    /// Each flag toggles a specific matching behavior (case sensitivity, whole-word,
    /// path matching, regex mode, accents/diacritics handling, prefix/suffix matching,
    /// or ignoring punctuation/whitespace).
    pub struct IpcSearchFlags: u32 {
        /// Match case sensitivity.
        const MATCH_CASE = 0x00000001;
        /// Match whole words only.
        const MATCH_WHOLEWORD = 0x00000002;
        /// Include file path when matching.
        const MATCH_PATH = 0x00000004;
        /// Treat search string as a regular expression.
        const REGEX = 0x00000008;
        /// Match accents (alias for MATCH_DIACRITICS).
        const MATCH_ACCENTS = 0x00000010;
        /// Match diacritics (alias for MATCH_ACCENTS).
        const MATCH_DIACRITICS = 0x00000010;
        /// Match by prefix (Everything 1.5).
        const MATCH_PREFIX = 0x00000020; // Everything 1.5
        /// Match by suffix (Everything 1.5).
        const MATCH_SUFFIX = 0x00000040; // Everything 1.5
        /// Ignore punctuation when matching (Everything 1.5).
        const IGNORE_PUNCTUATION = 0x00000080;
        /// Ignore whitespace when matching (Everything 1.5).
        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;
    }
}

// ALL string described below should be null-terminated.

#[repr(C)]
pub struct IpcCommandLine {
    pub show_command: u32,
    // UTF-8 encoded command line string follows
}

/// IPC Query structure
#[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,
    // Variable length search string follows
}

/// IPC Query2 structure for advanced queries
#[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,
    // Variable length search string follows
}

/// IPC Item structure
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcItem {
    pub flags: u32,
    pub filename_offset: u32,
    pub path_offset: u32,
}

/// IPC List structure
#[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,
    // Variable length items array follows
}

/// IPC Item2 structure for Query2
#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcItem2 {
    pub flags: u32,
    pub data_offset: u32,
}

/// IPC List2 structure for Query2 responses
#[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,
    // Variable length items array follows
}

#[repr(C, packed(1))]
#[derive(Debug, Copy, Clone)]
pub struct IpcRunHistory {
    pub run_count: u32,
    // Variable length path string follows
}

#[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)]
/// Sorting options for IPC queries. Selects the field and direction used to sort
/// search results returned by Everything. Use the variants to request sorting
/// by name, path, size, extension, type, dates, attributes, run count, etc.
pub enum IpcSort {
    /// Use Everything's configured default sort.
    #[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)]
    /// Request flags for Query2 responses.
    /// Each bit indicates a specific piece of item metadata to include in the
    /// Query2 response (for example: name, path, full path+name, extension, size,
    /// timestamps, attributes, file list filename, run count, recently changed date,
    /// or highlighted variants for client-side UI).
    pub struct Query2RequestFlags: u32 {
        /// Include the item name in the response.
        const NAME = 0x00000001;
        /// Include the item path in the response.
        const PATH = 0x00000002;
        /// Include the item's full path and name in the response.
        const FULL_PATH_AND_NAME = 0x00000004;
        /// Include the item extension in the response.
        const EXTENSION = 0x00000008;
        /// Include the item size in the response.
        const SIZE = 0x00000010;
        /// Include the item creation date in the response.
        const DATE_CREATED = 0x00000020;
        /// Include the item modification date in the response.
        const DATE_MODIFIED = 0x00000040;
        /// Include the item accessed date in the response.
        const DATE_ACCESSED = 0x00000080;
        /// Include the item attributes in the response.
        const ATTRIBUTES = 0x00000100;
        /// Include the item file list filename in the response.
        const FILE_LIST_FILE_NAME = 0x00000200;
        /// Include the item run count in the response.
        const RUN_COUNT = 0x00000400;
        /// Include the item run count in the response.
        const DATE_RUN = 0x00000800;
        /// Include the item recently changed date in the response.
        const DATE_RECENTLY_CHANGED = 0x00001000;
        /// Include highlighted item name in the response.
        const HIGHLIGHTED_NAME = 0x00002000;
        /// Include highlighted item path in the response.
        const HIGHLIGHTED_PATH = 0x00004000;
        /// Include highlighted item full path and name in the response.
        const HIGHLIGHTED_FULL_PATH_AND_NAME = 0x00008000;
    }
}

/// IPC File Info enumeration
#[repr(u32)]
#[derive(Debug, Copy, Clone)]
pub enum IpcFileInfo {
    /// File size
    FileSize = 1,
    /// Folder size
    FolderSize = 2,
    /// Creation date
    DateCreated = 3,
    /// Modification date
    DateModified = 4,
    /// Access date
    DateAccessed = 5,
    /// File attributes
    Attributes = 6,
}