Repository: srwi/EverythingToolbar
Branch: develop
Commit: dabaca656728
Files: 265
Total size: 2.2 MB
Directory structure:
gitextract_f0fongak/
├── .config/
│ └── dotnet-tools.json
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── config.yml
│ │ └── feature_request.yml
│ └── workflows/
│ ├── build.yml
│ ├── csharpier.yml
│ ├── release.yml
│ └── winget-release.yml
├── .gitignore
├── Directory.Build.props
├── EverythingSDK/
│ ├── EverythingSDK.vcxproj
│ ├── EverythingSDK.vcxproj.filters
│ ├── include/
│ │ ├── Everything.h
│ │ └── Everything_IPC.h
│ └── src/
│ ├── Everything.c
│ └── Everything64.def
├── EverythingToolbar/
│ ├── Behaviors/
│ │ ├── FlowDirectionAwareness.cs
│ │ ├── ThemeAwareness.cs
│ │ └── WpfUiBehavior.cs
│ ├── Controls/
│ │ ├── AcrylicWindow.cs
│ │ ├── FilterSelector.xaml
│ │ ├── FilterSelector.xaml.cs
│ │ ├── FluentMessageBox.cs
│ │ ├── GenericBanner.xaml
│ │ ├── GenericBanner.xaml.cs
│ │ ├── SearchBox.xaml
│ │ ├── SearchBox.xaml.cs
│ │ ├── SearchButton.xaml
│ │ ├── SearchButton.xaml.cs
│ │ ├── SearchResultPreviewPane.xaml
│ │ ├── SearchResultPreviewPane.xaml.cs
│ │ ├── SearchResultsView.xaml
│ │ ├── SearchResultsView.xaml.cs
│ │ ├── SettingItem.xaml
│ │ ├── SettingItem.xaml.cs
│ │ ├── SettingsControl.xaml
│ │ ├── SettingsControl.xaml.cs
│ │ ├── UpdateBanner.xaml
│ │ ├── UpdateBanner.xaml.cs
│ │ ├── UpdateSuccessfulBanner.xaml
│ │ └── UpdateSuccessfulBanner.xaml.cs
│ ├── Converters/
│ │ ├── BoolToVisibilityConverter.cs
│ │ ├── HighlightedTextConverter.cs
│ │ ├── NotConverter.cs
│ │ ├── NullToVisibilityConverter.cs
│ │ ├── PreviewPaneToggleIconConverter.cs
│ │ ├── SearchResultsCountConverter.cs
│ │ ├── SkipItemsConverter.cs
│ │ ├── TakeItemsConverter.cs
│ │ └── WindowsVersionToVisibilityConverter.cs
│ ├── Data/
│ │ ├── Filter.cs
│ │ ├── FocusBehavior.cs
│ │ ├── Rule.cs
│ │ └── SearchResult.cs
│ ├── EverythingToolbar.csproj
│ ├── Helpers/
│ │ ├── CultureHelper.cs
│ │ ├── DefaultFilterLoader.cs
│ │ ├── EventDispatcher.cs
│ │ ├── EverythingFilterLoader.cs
│ │ ├── FilterLoader.cs
│ │ ├── HistoryManager.cs
│ │ ├── IconProvider.cs
│ │ ├── NativeMethods.cs
│ │ ├── RegistryWatcher.cs
│ │ ├── ShellContextMenu.cs
│ │ ├── ShellUtils.cs
│ │ ├── ShortcutManager.cs
│ │ ├── StartMenuIntegration.cs
│ │ ├── TaskbarStateManager.cs
│ │ ├── ToolbarLogger.cs
│ │ └── Utils.cs
│ ├── Images/
│ │ └── WinUIGallery/
│ │ └── LICENSE
│ ├── ItemTemplates/
│ │ ├── Compact.xaml
│ │ ├── CompactDetailed.xaml
│ │ ├── Normal.xaml
│ │ └── NormalDetailed.xaml
│ ├── Properties/
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.af.Designer.cs
│ │ ├── Resources.af.resx
│ │ ├── Resources.ar.Designer.cs
│ │ ├── Resources.ar.resx
│ │ ├── Resources.ca.Designer.cs
│ │ ├── Resources.ca.resx
│ │ ├── Resources.cs.Designer.cs
│ │ ├── Resources.cs.resx
│ │ ├── Resources.da.Designer.cs
│ │ ├── Resources.da.resx
│ │ ├── Resources.de.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.el.Designer.cs
│ │ ├── Resources.el.resx
│ │ ├── Resources.es.Designer.cs
│ │ ├── Resources.es.resx
│ │ ├── Resources.fa.resx
│ │ ├── Resources.fi.Designer.cs
│ │ ├── Resources.fi.resx
│ │ ├── Resources.fr.Designer.cs
│ │ ├── Resources.fr.resx
│ │ ├── Resources.he.Designer.cs
│ │ ├── Resources.he.resx
│ │ ├── Resources.hu.Designer.cs
│ │ ├── Resources.hu.resx
│ │ ├── Resources.it.Designer.cs
│ │ ├── Resources.it.resx
│ │ ├── Resources.ja.Designer.cs
│ │ ├── Resources.ja.resx
│ │ ├── Resources.ko-KR.Designer.cs
│ │ ├── Resources.ko-KR.resx
│ │ ├── Resources.nl.Designer.cs
│ │ ├── Resources.nl.resx
│ │ ├── Resources.no.Designer.cs
│ │ ├── Resources.no.resx
│ │ ├── Resources.pl.Designer.cs
│ │ ├── Resources.pl.resx
│ │ ├── Resources.pt-BR.Designer.cs
│ │ ├── Resources.pt-BR.resx
│ │ ├── Resources.pt.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ro.Designer.cs
│ │ ├── Resources.ro.resx
│ │ ├── Resources.ru.Designer.cs
│ │ ├── Resources.ru.resx
│ │ ├── Resources.sr.Designer.cs
│ │ ├── Resources.sr.resx
│ │ ├── Resources.sv.Designer.cs
│ │ ├── Resources.sv.resx
│ │ ├── Resources.tr.Designer.cs
│ │ ├── Resources.tr.resx
│ │ ├── Resources.ug.resx
│ │ ├── Resources.uk.Designer.cs
│ │ ├── Resources.uk.resx
│ │ ├── Resources.uz.resx
│ │ ├── Resources.vi.Designer.cs
│ │ ├── Resources.vi.resx
│ │ ├── Resources.zh-Hans.Designer.cs
│ │ ├── Resources.zh-Hans.resx
│ │ ├── Resources.zh.resx
│ │ └── app.manifest
│ ├── Search/
│ │ ├── IItemsProvider.cs
│ │ ├── SearchResultProvider.cs
│ │ ├── SearchState.cs
│ │ ├── SynchronizationContextTaskScheduler.cs
│ │ └── VirtualizingCollection.cs
│ ├── SearchWindow.xaml
│ ├── SearchWindow.xaml.cs
│ ├── Settings/
│ │ ├── About.xaml
│ │ ├── About.xaml.cs
│ │ ├── Advanced.xaml
│ │ ├── Advanced.xaml.cs
│ │ ├── CustomActions.xaml
│ │ ├── CustomActions.xaml.cs
│ │ ├── Filters.xaml
│ │ ├── Filters.xaml.cs
│ │ ├── Search.xaml
│ │ ├── Search.xaml.cs
│ │ ├── SettingsWindow.xaml
│ │ ├── SettingsWindow.xaml.cs
│ │ ├── Shortcuts.xaml
│ │ ├── Shortcuts.xaml.cs
│ │ ├── UserInterface.xaml
│ │ └── UserInterface.xaml.cs
│ ├── Styles/
│ │ ├── ContextMenu.xaml
│ │ ├── PillComboBox.xaml
│ │ ├── PillTabControl.xaml
│ │ ├── PreviewActionButton.xaml
│ │ ├── QuickSettingsToggle.xaml
│ │ ├── Scrollbar.xaml
│ │ ├── TabBarButton.xaml
│ │ ├── TabComboBox.xaml
│ │ ├── TabControl.xaml
│ │ ├── TextBox.xaml
│ │ └── UpdateBannerButton.xaml
│ ├── Themes/
│ │ ├── Win10/
│ │ │ ├── Controls/
│ │ │ │ ├── ContextMenu.xaml
│ │ │ │ ├── FilterSelector.xaml
│ │ │ │ ├── ListViewItem.xaml
│ │ │ │ ├── QuickSettingsToggle.xaml
│ │ │ │ ├── Scrollbar.xaml
│ │ │ │ ├── SearchBox.xaml
│ │ │ │ ├── SearchResultPreviewPane.xaml
│ │ │ │ ├── SearchWindow.xaml
│ │ │ │ ├── TabBarButton.xaml
│ │ │ │ ├── TextBox.xaml
│ │ │ │ └── UpdateBanner.xaml
│ │ │ ├── DARK.xaml
│ │ │ └── LIGHT.xaml
│ │ └── Win11/
│ │ ├── Controls/
│ │ │ ├── ContextMenu.xaml
│ │ │ ├── FilterSelector.xaml
│ │ │ ├── ListViewItem.xaml
│ │ │ ├── QuickSettingsToggle.xaml
│ │ │ ├── Scrollbar.xaml
│ │ │ ├── SearchBox.xaml
│ │ │ ├── SearchResultPreviewPane.xaml
│ │ │ ├── SearchWindow.xaml
│ │ │ ├── TabBarButton.xaml
│ │ │ ├── TextBox.xaml
│ │ │ └── UpdateBanner.xaml
│ │ ├── DARK.xaml
│ │ └── LIGHT.xaml
│ └── ToolbarSettings.cs
├── EverythingToolbar.Deskband/
│ ├── CSDeskBand.cs
│ ├── Converters/
│ │ └── SearchControlVisibilityConverter.cs
│ ├── EverythingToolbar.Deskband.csproj
│ ├── Server.cs
│ ├── ToolbarControl.xaml
│ ├── ToolbarControl.xaml.cs
│ └── WindowPlacement.cs
├── EverythingToolbar.Launcher/
│ ├── EverythingToolbar.Launcher.csproj
│ ├── Launcher.cs
│ ├── Properties/
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.af.resx
│ │ ├── Resources.ar.resx
│ │ ├── Resources.ca.resx
│ │ ├── Resources.cs.resx
│ │ ├── Resources.da.resx
│ │ ├── Resources.de.resx
│ │ ├── Resources.el.resx
│ │ ├── Resources.es.resx
│ │ ├── Resources.fa.resx
│ │ ├── Resources.fi.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.he.resx
│ │ ├── Resources.hu.resx
│ │ ├── Resources.it.resx
│ │ ├── Resources.ja.resx
│ │ ├── Resources.ko-KR.resx
│ │ ├── Resources.nl.resx
│ │ ├── Resources.no.resx
│ │ ├── Resources.pl.resx
│ │ ├── Resources.pt-BR.resx
│ │ ├── Resources.pt.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ro.resx
│ │ ├── Resources.ru.resx
│ │ ├── Resources.sr.resx
│ │ ├── Resources.sv.resx
│ │ ├── Resources.tr.resx
│ │ ├── Resources.ug.resx
│ │ ├── Resources.uk.resx
│ │ ├── Resources.uz.resx
│ │ ├── Resources.vi.resx
│ │ ├── Resources.zh-Hans.resx
│ │ ├── Resources.zh.resx
│ │ └── app.manifest
│ ├── SetupAssistant.xaml
│ ├── SetupAssistant.xaml.cs
│ ├── Utils.cs
│ └── WindowPlacement.cs
├── EverythingToolbar.sln
├── FAQ.md
├── Installer/
│ ├── DotNetInstaller.iss
│ ├── InnoDependencyInstaller/
│ │ ├── CodeDependencies.iss
│ │ └── LICENSE.md
│ ├── Installer-arm64.iss
│ ├── Installer-x64.iss
│ ├── SharedInstaller.iss
│ └── WixUninstaller.iss
├── LICENSE
├── README.md
├── README.zh-CN.md
├── crowdin.yml
└── tools/
├── clean_solution.cmd
├── install_deskband.cmd
└── uninstall_deskband.cmd
================================================
FILE CONTENTS
================================================
================================================
FILE: .config/dotnet-tools.json
================================================
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.0.3",
"commands": [
"csharpier"
],
"rollForward": false
}
}
}
================================================
FILE: .editorconfig
================================================
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
max_line_length = 120
# New line preferences
end_of_line = crlf
insert_final_newline = false
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
# Field preferences
dotnet_style_readonly_field = true
# Parameter preferences
dotnet_code_quality_unused_parameters = all:silent
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none
# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false
# Expression-bodied members
csharp_style_expression_bodied_accessors = true
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_indexers = true
csharp_style_expression_bodied_lambdas = true
csharp_style_expression_bodied_local_functions = false
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = true
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_switch_expression = true
# Null-checking preferences
csharp_style_conditional_delegate_call = true
# Modifier preferences
csharp_prefer_static_local_function = true
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true
# Code-block preferences
csharp_prefer_braces = true
csharp_prefer_simple_using_statement = true
csharp_style_namespace_declarations = block_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_primary_constructors = true
csharp_style_prefer_top_level_statements = true
# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_index_operator = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
================================================
FILE: .github/FUNDING.yml
================================================
ko_fi: stephanrwi
custom: ['https://paypal.me/rumswinkel']
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: Bug report
description: Create a bug report
body:
- type: checkboxes
attributes:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have fully read the [README](https://github.com/srwi/EverythingToolbar/blob/develop/README.md) and it did not solve the problem.
required: true
- label: I have read the [FAQ](https://github.com/srwi/EverythingToolbar/blob/develop/FAQ.md) and it did not solve the problem.
required: true
- label: I have searched all [open and closed issues](https://github.com/srwi/EverythingToolbar/issues?q=) for the same bug report without success.
required: true
- id: version
type: input
attributes:
label: EverythingToolbar Version
description: What version of EverythingToolbar are you using?
placeholder: "e.g. 2.0.0"
validations:
required: true
- type: dropdown
id: variant
attributes:
label: Variant
description: What variant of EverythingToolbar are you using? [What are the different variants?](https://github.com/srwi/EverythingToolbar/blob/develop/FAQ.md#-what-is-the-difference-between-the-deskband-and-launcher-variants-of-everythingtoolbar)
options:
- Not applicable / Don't know
- Search icon / Launcher
- Deskband
validations:
required: true
- id: et_version
type: input
attributes:
label: Everything Version
description: What version of Everything are you using?
placeholder: "e.g. 1.4.1.1024 (x64)"
validations:
required: true
- id: windows_version
type: input
attributes:
label: Windows Version
description: What Windows version are you using? Click Start button > Settings > System > About.
placeholder: "e.g. Windows 11 24H2"
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Describe exactly how to reproduce the behaviour.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: A clear description of what actually happens.
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem. You can simply drag and drop any image file into the editor to add it to the report.
- type: textarea
attributes:
label: Log output
description: To copy the log file output press Win+R, run `%TEMP%\EverythingToolbar.log` and paste the file content below. Please provide the log file even if you think it does not contain relevant information.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: Are there any other details that may be relevant to the issue like unusual system configurations or third party software that may be involved?
- type: checkboxes
id: ensure_effort
attributes:
label: Final Checklist
description: Before submitting, please confirm the following to help provide better support.
options:
- label: I have provided detailed, clear information in all required fields above and put genuine effort into this bug report.
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: Check the FAQ
url: https://github.com/srwi/EverythingToolbar/blob/develop/FAQ.md
about: Check frequently asked questions and troubleshooting guides
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yml
================================================
name: Feature request
description: Suggest an idea for this project
body:
- type: checkboxes
attributes:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [FAQ](https://github.com/srwi/EverythingToolbar/blob/develop/FAQ.md) and it did not solve the problem.
required: true
- label: I have searched all [open and closed issues](https://github.com/srwi/EverythingToolbar/issues?q=) for the same feature request without success.
required: true
- type: textarea
attributes:
label: Problem Description
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Proposed Solution
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: Add any other context or screenshots about the feature request here.
================================================
FILE: .github/workflows/build.yml
================================================
name: Build solution
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: windows-2025
arch: x64
installer: Installer-x64.iss
- runner: windows-11-arm
arch: arm64
installer: Installer-arm64.iss
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Install NuGet
uses: nuget/setup-nuget@v1
- name: Restore NuGet dependencies
run: nuget restore
- name: Build all
run: MSBuild $Env:GITHUB_WORKSPACE /p:Configuration=Release /p:Platform=${{ matrix.arch }} /p:SignAssembly=false /p:DelaySign=false
- name: Install Inno Setup
run: choco install innosetup -y --version 6.5.4 --allow-downgrade
- name: Build installer
run: iscc "Installer\${{ matrix.installer }}"
- name: Upload installer artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: EverythingToolbar-Installer-${{ matrix.arch }}
path: Installer/Output/*.exe
================================================
FILE: .github/workflows/csharpier.yml
================================================
name: CSharpier check
on: [push, pull_request]
jobs:
check_formatting:
runs-on: windows-2025
name: Check Formatting
steps:
- uses: actions/checkout@v2
- run: |
dotnet tool restore
dotnet csharpier check .
================================================
FILE: .github/workflows/release.yml
================================================
name: Publish release
on:
push:
tags:
- '*'
jobs:
build-release:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: windows-2025
arch: x64
installer: Installer-x64.iss
- runner: windows-11-arm
arch: arm64
installer: Installer-arm64.iss
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Install NuGet
uses: nuget/setup-nuget@v1
- name: Restore NuGet dependencies
run: nuget restore
- name: Decode certificate
shell: bash
run: echo ${{ secrets.PFX_CERTIFICATE_FILE }} | base64 --decode > ./EverythingToolbar.snk
- name: Build all
run: MSBuild $Env:GITHUB_WORKSPACE /p:Configuration=Release /p:Platform=${{ matrix.arch }}
- name: Install Inno Setup
run: choco install innosetup -y --version 6.5.4 --allow-downgrade
- name: Build installer
run: iscc /F"EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}" "Installer\${{ matrix.installer }}"
- name: Generate SHA-256 checksum
shell: bash
run: sha256sum Installer/output/EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}.exe > Installer/output/EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}.sha256
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: EverythingToolbar ${{ github.ref_name }} ${{ matrix.arch }}
path: |
Installer/output/EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}.exe
Installer/output/EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}.sha256
- name: Create release draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" `
"Installer/output/EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}.exe" `
"Installer/output/EverythingToolbar-${{ github.ref_name }}-${{ matrix.arch }}.sha256" `
--draft `
--title "${{ github.ref_name }}"
================================================
FILE: .github/workflows/winget-release.yml
================================================
name: Publish to WinGet
on:
release:
types: [released]
workflow_dispatch:
inputs:
version_tag:
description: 'Tag to run winget-releaser for'
required: true
jobs:
winget:
name: Publish to WinGet
# winget-releaser is cross-platform, we use ubuntu cause it uses less resources than windows
runs-on: ubuntu-latest
steps:
# LAUNCHER
- name: Update Launcher
# we peg winget-releaser to v2 for stability
uses: vedantmgoyal9/winget-releaser@v2
with:
identifier: srwi.EverythingToolbar.Launcher
token: ${{ secrets.WINGET_PAT }}
# regex assumes there's only one file ending with x64.exe and arm64.exe in each release
# if this changes in the future, modify the regex accordingly, in both launcher and deskband!
installers-regex: '-x64\.exe$|-arm64\.exe$'
# if there was a version_tag supplied (manual run) use that, otherwise determine it automatically
release-tag: ${{ inputs.version_tag || github.event.release.tag_name }}
# DESKBAND
- name: Update Deskband
uses: vedantmgoyal9/winget-releaser@v2
with:
identifier: srwi.EverythingToolbar.Deskband
token: ${{ secrets.WINGET_PAT }}
installers-regex: '-x64\.exe$|-arm64\.exe$'
release-tag: ${{ inputs.version_tag || github.event.release.tag_name }}
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.snk
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
HeatGeneratedFileList.wxs
================================================
FILE: Directory.Build.props
================================================
2.3.0.0
2.3.0.0
false
true
true
================================================
FILE: EverythingSDK/EverythingSDK.vcxproj
================================================
Debug
x64
Release
x64
Debug
ARM64
Release
ARM64
17.0
{BF806AC1-5839-4DAA-90F2-9D6F2B65C0FD}
EverythingSDK
Win32Proj
EverythingSDK
10.0
x64
DynamicLibrary
v143
false
Unicode
DynamicLibrary
v143
Unicode
DynamicLibrary
v143
false
Unicode
DynamicLibrary
v143
Unicode
<_ProjectFileVersion>17.0.32819.101
$(Platform)\$(Configuration)\
$(Platform)\$(Configuration)\
Everything64
$(Platform)\$(Configuration)\
$(Platform)\$(Configuration)\
Everything64
$(Platform)\$(Configuration)\
$(Platform)\$(Configuration)\
Everything64
$(Platform)\$(Configuration)\
$(Platform)\$(Configuration)\
Everything64
X64
Disabled
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
EnableFastChecks
MultiThreadedDebug
Level3
ProgramDatabase
$(OutDir)Everything.lib
$(OutDir)Everything64.dll
X64
MaxSpeed
AnySuitable
true
Speed
false
false
WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
true
Default
MultiThreaded
true
Fast
Level3
CompileAsC
$(OutDir)Everything64.dll
$(ProjectDir)src\Everything64.def
MachineX64
ARM64
Disabled
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
EnableFastChecks
MultiThreadedDebug
Level3
ProgramDatabase
$(OutDir)Everything.lib
$(OutDir)Everything64.dll
ARM64
MaxSpeed
AnySuitable
true
Speed
false
false
WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
true
Default
MultiThreaded
true
Fast
Level3
CompileAsC
$(OutDir)Everything64.dll
$(ProjectDir)src\Everything64.def
MachineARM64
================================================
FILE: EverythingSDK/EverythingSDK.vcxproj.filters
================================================
{9dbb0c28-41a5-4249-8a02-5bf84bc8e3f5}
cpp;c;cxx;def;odl;idl;hpj;bat;asm
src
================================================
FILE: EverythingSDK/include/Everything.h
================================================
//
// Copyright (C) 2016 David Carpenter
//
// Permission is hereby granted, free of charge,
// to any person obtaining a copy of this software
// and associated documentation files (the "Software"),
// to deal in the Software without restriction,
// including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#ifndef _EVERYTHING_DLL_
#define _EVERYTHING_DLL_
#ifndef _INC_WINDOWS
#include
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define EVERYTHING_OK 0 // no error detected
#define EVERYTHING_ERROR_MEMORY 1 // out of memory.
#define EVERYTHING_ERROR_IPC 2 // Everything search client is not running
#define EVERYTHING_ERROR_REGISTERCLASSEX 3 // unable to register window class.
#define EVERYTHING_ERROR_CREATEWINDOW 4 // unable to create listening window
#define EVERYTHING_ERROR_CREATETHREAD 5 // unable to create listening thread
#define EVERYTHING_ERROR_INVALIDINDEX 6 // invalid index
#define EVERYTHING_ERROR_INVALIDCALL 7 // invalid call
#define EVERYTHING_ERROR_INVALIDREQUEST 8 // invalid request data, request data first.
#define EVERYTHING_ERROR_INVALIDPARAMETER 9 // bad parameter.
#define EVERYTHING_SORT_NAME_ASCENDING 1
#define EVERYTHING_SORT_NAME_DESCENDING 2
#define EVERYTHING_SORT_PATH_ASCENDING 3
#define EVERYTHING_SORT_PATH_DESCENDING 4
#define EVERYTHING_SORT_SIZE_ASCENDING 5
#define EVERYTHING_SORT_SIZE_DESCENDING 6
#define EVERYTHING_SORT_EXTENSION_ASCENDING 7
#define EVERYTHING_SORT_EXTENSION_DESCENDING 8
#define EVERYTHING_SORT_TYPE_NAME_ASCENDING 9
#define EVERYTHING_SORT_TYPE_NAME_DESCENDING 10
#define EVERYTHING_SORT_DATE_CREATED_ASCENDING 11
#define EVERYTHING_SORT_DATE_CREATED_DESCENDING 12
#define EVERYTHING_SORT_DATE_MODIFIED_ASCENDING 13
#define EVERYTHING_SORT_DATE_MODIFIED_DESCENDING 14
#define EVERYTHING_SORT_ATTRIBUTES_ASCENDING 15
#define EVERYTHING_SORT_ATTRIBUTES_DESCENDING 16
#define EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING 17
#define EVERYTHING_SORT_FILE_LIST_FILENAME_DESCENDING 18
#define EVERYTHING_SORT_RUN_COUNT_ASCENDING 19
#define EVERYTHING_SORT_RUN_COUNT_DESCENDING 20
#define EVERYTHING_SORT_DATE_RECENTLY_CHANGED_ASCENDING 21
#define EVERYTHING_SORT_DATE_RECENTLY_CHANGED_DESCENDING 22
#define EVERYTHING_SORT_DATE_ACCESSED_ASCENDING 23
#define EVERYTHING_SORT_DATE_ACCESSED_DESCENDING 24
#define EVERYTHING_SORT_DATE_RUN_ASCENDING 25
#define EVERYTHING_SORT_DATE_RUN_DESCENDING 26
#define EVERYTHING_REQUEST_FILE_NAME 0x00000001
#define EVERYTHING_REQUEST_PATH 0x00000002
#define EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME 0x00000004
#define EVERYTHING_REQUEST_EXTENSION 0x00000008
#define EVERYTHING_REQUEST_SIZE 0x00000010
#define EVERYTHING_REQUEST_DATE_CREATED 0x00000020
#define EVERYTHING_REQUEST_DATE_MODIFIED 0x00000040
#define EVERYTHING_REQUEST_DATE_ACCESSED 0x00000080
#define EVERYTHING_REQUEST_ATTRIBUTES 0x00000100
#define EVERYTHING_REQUEST_FILE_LIST_FILE_NAME 0x00000200
#define EVERYTHING_REQUEST_RUN_COUNT 0x00000400
#define EVERYTHING_REQUEST_DATE_RUN 0x00000800
#define EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED 0x00001000
#define EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME 0x00002000
#define EVERYTHING_REQUEST_HIGHLIGHTED_PATH 0x00004000
#define EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME 0x00008000
#define EVERYTHING_TARGET_MACHINE_X86 1
#define EVERYTHING_TARGET_MACHINE_X64 2
#define EVERYTHING_TARGET_MACHINE_ARM 3
#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 dwId);
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetSort(DWORD dwSort); // Everything 1.4.1
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetRequestFlags(DWORD dwRequestFlags); // Everything 1.4.1
// 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);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetSort(void); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRequestFlags(void); // Everything 1.4.1
// execute query
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait);
// query reply
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD dwId);
// write result state
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SortResultsByPath(void);
// read result state
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumFileResults(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumFolderResults(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumResults(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotFileResults(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotFolderResults(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotResults(void);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsVolumeResult(DWORD dwIndex);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFolderResult(DWORD dwIndex);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFileResult(DWORD dwIndex);
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(DWORD dwIndex);
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(DWORD dwIndex);
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(DWORD dwIndex);
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultPathA(DWORD dwIndex);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultFullPathNameA(DWORD dwIndex,LPSTR buf,DWORD bufsize);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultFullPathNameW(DWORD dwIndex,LPWSTR wbuf,DWORD wbuf_size_in_wchars);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListSort(void); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListRequestFlags(void); // Everything 1.4.1
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultExtensionW(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultExtensionA(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultSize(DWORD dwIndex,LARGE_INTEGER *lpSize); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateCreated(DWORD dwIndex,FILETIME *lpDateCreated); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateModified(DWORD dwIndex,FILETIME *lpDateModified); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateAccessed(DWORD dwIndex,FILETIME *lpDateAccessed); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultAttributes(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileListFileNameW(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileListFileNameA(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultRunCount(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateRun(DWORD dwIndex,FILETIME *lpDateRun);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetResultDateRecentlyChanged(DWORD dwIndex,FILETIME *lpDateRecentlyChanged);
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameW(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameA(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedPathW(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedPathA(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameW(DWORD dwIndex); // Everything 1.4.1
EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameA(DWORD dwIndex); // Everything 1.4.1
// reset state and free any allocated memory
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_Reset(void);
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_CleanUp(void);
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetInstanceName(LPCWSTR name);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMajorVersion(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMinorVersion(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRevision(void);
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetBuildNumber(void);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_Exit(void);
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsDBLoaded(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsAdmin(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsAppData(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_RebuildDB(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_UpdateAllFolderIndexes(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SaveDB(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SaveRunHistory(void); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_DeleteRunHistory(void); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTargetMachine(void); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameW(LPCWSTR lpFileName); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameA(LPCSTR lpFileName); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameW(LPCWSTR lpFileName,DWORD dwRunCount); // Everything 1.4.1
EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameA(LPCSTR lpFileName,DWORD dwRunCount); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameW(LPCWSTR lpFileName); // Everything 1.4.1
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameA(LPCSTR lpFileName); // Everything 1.4.1
#ifdef UNICODE
#define Everything_SetSearch Everything_SetSearchW
#define Everything_GetSearch Everything_GetSearchW
#define Everything_Query Everything_QueryW
#define Everything_Query2 Everything_Query2W
#define Everything_GetResultFileName Everything_GetResultFileNameW
#define Everything_GetResultPath Everything_GetResultPathW
#define Everything_GetResultFullPathName Everything_GetResultFullPathNameW
#define Everything_GetResultExtension Everything_GetResultExtensionW
#define Everything_GetResultFileListFileName Everything_GetResultFileListFileNameW
#define Everything_GetResultHighlightedFileName Everything_GetResultHighlightedFileNameW
#define Everything_GetResultHighlightedPath Everything_GetResultHighlightedPathW
#define Everything_GetResultHighlightedFullPathAndFileName Everything_GetResultHighlightedFullPathAndFileNameW
#define Everything_GetRunCountFromFileName Everything_GetRunCountFromFileNameW
#define Everything_SetRunCountFromFileName Everything_SetRunCountFromFileNameW
#define Everything_IncRunCountFromFileName Everything_IncRunCountFromFileNameW
#else
#define Everything_SetSearch Everything_SetSearchA
#define Everything_GetSearch Everything_GetSearchA
#define Everything_Query Everything_QueryA
#define Everything_Query2 Everything_Query2A
#define Everything_GetResultFileName Everything_GetResultFileNameA
#define Everything_GetResultPath Everything_GetResultPathA
#define Everything_GetResultFullPathName Everything_GetResultFullPathNameA
#define Everything_GetResultExtension Everything_GetResultExtensionA
#define Everything_GetResultFileListFileName Everything_GetResultFileListFileNameA
#define Everything_GetResultHighlightedFileName Everything_GetResultHighlightedFileNameA
#define Everything_GetResultHighlightedPath Everything_GetResultHighlightedPathA
#define Everything_GetResultHighlightedFullPathAndFileName Everything_GetResultHighlightedFullPathAndFileNameA
#define Everything_GetRunCountFromFileName Everything_GetRunCountFromFileNameA
#define Everything_SetRunCountFromFileName Everything_SetRunCountFromFileNameA
#define Everything_IncRunCountFromFileName Everything_IncRunCountFromFileNameA
#endif
#ifdef __cplusplus
}
#endif
#endif
================================================
FILE: EverythingSDK/include/Everything_IPC.h
================================================
// Everything IPC
#ifndef _EVERYTHING_IPC_H_
#define _EVERYTHING_IPC_H_
// C
#ifdef __cplusplus
extern "C" {
#endif
#define EVERYTHING_WM_IPC (WM_USER)
#define EVERYTHING_IPC_TARGET_MACHINE_X86 1
#define EVERYTHING_IPC_TARGET_MACHINE_X64 2
#define EVERYTHING_IPC_TARGET_MACHINE_ARM 3
#define EVERYTHING_IPC_TARGET_MACHINE_ARM64 4
// built in filters
#define EVERYTHING_IPC_FILTER_EVERYTHING 0
#define EVERYTHING_IPC_FILTER_AUDIO 1
#define EVERYTHING_IPC_FILTER_COMPRESSED 2
#define EVERYTHING_IPC_FILTER_DOCUMENT 3
#define EVERYTHING_IPC_FILTER_EXECUTABLE 4
#define EVERYTHING_IPC_FILTER_FOLDER 5
#define EVERYTHING_IPC_FILTER_PICTURE 6
#define EVERYTHING_IPC_FILTER_VIDEO 7
#define EVERYTHING_IPC_FILTER_CUSTOM 8
// EVERYTHING_WM_IPC (send to the Everything taskbar notification window)
// the Everything taskbar notification window is always created when Everything is running. (even when the taskbar notification icon is hidden)
// HWND everything_taskbar_notification_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0);
// SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_*,lParam)
// version format: major.minor.revision.build
// example: 1.4.1.877
#define EVERYTHING_IPC_GET_MAJOR_VERSION 0 // int major_version = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_MAJOR_VERSION,0);
#define EVERYTHING_IPC_GET_MINOR_VERSION 1 // int minor_version = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_MINOR_VERSION,0);
#define EVERYTHING_IPC_GET_REVISION 2 // int revision = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_REVISION,0);
#define EVERYTHING_IPC_GET_BUILD_NUMBER 3 // int build = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_BUILD,0);
#define EVERYTHING_IPC_EXIT 4 // returns 1 if the program closes.
#define EVERYTHING_IPC_GET_TARGET_MACHINE 5 // int target_machine = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_TARGET_MACHINE,0); returns 0 if not supported. returns a EVERYTHING_IPC_TARGET_MACHINE_* value. requires Everything 1.4.1
// uninstall options
#define EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS 100 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT 101 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT 102 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU 103 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP 104 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP,0);
#define EVERYTHING_IPC_DELETE_URL_PROTOCOL 105 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_URL_PROTOCOL,0);
// install options
#define EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS 200 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT 201 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT 202 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU 203 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP 204 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP,0);
#define EVERYTHING_IPC_CREATE_URL_PROTOCOL 205 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_CREATE_URL_PROTOCOL,0);
// get option status; 0 = no, 1 = yes, 2 = indeterminate (partially installed)
#define EVERYTHING_IPC_IS_START_MENU_SHORTCUTS 300 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_START_MENU_SHORTCUTS,0);
#define EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT 301 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT,0);
#define EVERYTHING_IPC_IS_DESKTOP_SHORTCUT 302 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DESKTOP_SHORTCUT,0);
#define EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU 303 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU,0);
#define EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP 304 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP,0);
#define EVERYTHING_IPC_IS_URL_PROTOCOL 305 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_URL_PROTOCOL,0);
#define EVERYTHING_IPC_IS_SERVICE 306 // int ret = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_SERVICE,0);
// indexing
#define EVERYTHING_IPC_IS_NTFS_DRIVE_INDEXED 400 // int is_indexed = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_NTFS_DRIVE_INDEXED,drive_index); drive_index: 0-25 = 0=A:, 1=B:, 2=C:...
// requires Everything 1.4:
#define EVERYTHING_IPC_IS_DB_LOADED 401 // int is_db_loaded = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DB_LOADED,0);
#define EVERYTHING_IPC_IS_DB_BUSY 402 // int is_db_busy = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DB_BUSY,0); // db is busy, issueing another action will cancel the current one (if possible).
#define EVERYTHING_IPC_IS_ADMIN 403 // int is_admin = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_ADMIN,0);
#define EVERYTHING_IPC_IS_APPDATA 404 // int is_appdata = (int)SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_APPDATA,0);
#define EVERYTHING_IPC_REBUILD_DB 405 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_REBUILD,0); // forces all indexes to be rescanned.
#define EVERYTHING_IPC_UPDATE_ALL_FOLDER_INDEXES 406 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_UPDATE_ALL_FOLDER_INDEXES,0); // rescan all folder indexes.
#define EVERYTHING_IPC_SAVE_DB 407 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_SAVE_DB,0); // save the db to disk.
#define EVERYTHING_IPC_SAVE_RUN_HISTORY 408 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_SAVE_RUN_HISTORY,0); // save run history to disk.
#define EVERYTHING_IPC_DELETE_RUN_HISTORY 409 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_DELETE_RUN_HISTORY,0); // deletes all run history from memory and disk.
#define EVERYTHING_IPC_IS_FAST_SORT 410 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FAST_SORT,EVERYTHING_IPC_SORT_*); // is the sort information indexed?
#define EVERYTHING_IPC_IS_FILE_INFO_INDEXED 411 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FILE_INFO_INDEXED,EVERYTHING_IPC_FILE_INFO_*); // is the file/folder info indexed?
// Everything 1.5
#define EVERYTHING_IPC_QUEUE_REBUILD_DB 412 // SendMessage(everything_taskbar_notification_hwnd,EVERYTHING_WM_IPC,EVERYTHING_IPC_QUEUE_REBUILD_DB,0); // forces all indexes to be rescanned when the db is ready.
// send the following to an existing Everything search window (requires Everything 1.4.1)
// SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_*,0);
#define EVERYTHING_IPC_IS_MATCH_CASE 500 // int is_match_case = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_CASE,0);
#define EVERYTHING_IPC_IS_MATCH_WHOLE_WORD 501 // int is_match_whole_words = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_WHOLE_WORD,0);
#define EVERYTHING_IPC_IS_MATCH_PATH 502 // int is_match_path = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_PATH,0);
#define EVERYTHING_IPC_IS_MATCH_DIACRITICS 503 // int is_match_diacritics = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_DIACRITICS,0);
#define EVERYTHING_IPC_IS_REGEX 504 // int is_regex = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_REGEX,0);
#define EVERYTHING_IPC_IS_FILTERS 505 // int is_filters = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_FILTERS,0);
#define EVERYTHING_IPC_IS_PREVIEW 506 // int is_preview = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_PREVIEW,0);
#define EVERYTHING_IPC_IS_STATUS_BAR 507 // int is_status_bar = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_STATUS_BAR,0);
#define EVERYTHING_IPC_IS_DETAILS 508 // int is_details = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_DETAILS,0);
#define EVERYTHING_IPC_GET_THUMBNAIL_SIZE 509 // int thumbnail_size = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_GET_THUMBNAIL_SIZE,0); 0 = details
#define EVERYTHING_IPC_GET_SORT 510 // int sort = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_GET_SORT,0); sort can be one of EVERYTHING_IPC_SORT_* types.
#define EVERYTHING_IPC_GET_ON_TOP 511 // int on_top = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_ON_TOP,0); 0=never, 1=always, 2=while searching.
#define EVERYTHING_IPC_GET_FILTER 512 // int filter = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_FILTER,0); filter can be one of EVERYTHING_IPC_FILTER_* types.
#define EVERYTHING_IPC_GET_FILTER_INDEX 513 // int filter_index = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_GET_FILTER_INDEX,0);
// Everything 1.5
#define EVERYTHING_IPC_IS_MATCH_PREFIX 514 // int is_match_prefix = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_PREFIX,0);
#define EVERYTHING_IPC_IS_MATCH_SUFFIX 515 // int is_match_suffix = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_MATCH_SUFFIX,0);
#define EVERYTHING_IPC_IS_IGNORE_PUNCTUATION 516 // int is_ignore_punctuation = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_IGNORE_PUNCTUATION,0);
#define EVERYTHING_IPC_IS_IGNORE_WHITESPACE 517 // int is_ignore_whitespace = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_IGNORE_WHITESPACE,0);
#define EVERYTHING_IPC_IS_SEARCH_AS_YOU_TYPE 518 // int is_search_as_you_type = (int)SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),EVERYTHING_WM_IPC,EVERYTHING_IPC_IS_SEARCH_AS_YOU_TYPE,0);
// command IDs to send to an Everything search window.
// SendMessage(FindWindow(EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS,0),WM_COMMAND,MAKEWPARAM(EVERYTHING_IPC_ID_*,0),0);
// main menus
#define EVERYTHING_IPC_ID_FILE_MENU 10001
#define EVERYTHING_IPC_ID_EDIT_MENU 10002
#define EVERYTHING_IPC_ID_SEARCH_MENU 10003
#define EVERYTHING_IPC_ID_TOOLS_MENU 10004
#define EVERYTHING_IPC_ID_HELP_MENU 10005
#define EVERYTHING_IPC_ID_TOOLBAR 10006
#define EVERYTHING_IPC_ID_SEARCH_EDIT 10007
#define EVERYTHING_IPC_ID_FILTER 10008
#define EVERYTHING_IPC_ID_RESULTS_HEADER 10009
#define EVERYTHING_IPC_ID_STATUS 10010
#define EVERYTHING_IPC_ID_VIEW_ZOOM_MENU 10012
#define EVERYTHING_IPC_ID_VIEW_MENU 10013
#define EVERYTHING_IPC_ID_VIEW_WINDOW_SIZE_MENU 10019
#define EVERYTHING_IPC_ID_RESULT_LIST 10020
#define EVERYTHING_IPC_ID_BOOKMARKS_MENU 10021
#define EVERYTHING_IPC_ID_VIEW_SORT_BY_MENU 10022
#define EVERYTHING_IPC_ID_VIEW_GOTO_MENU 10024
#define EVERYTHING_IPC_ID_VIEW_ONTOP_MENU 10025
#define EVERYTHING_IPC_ID_PREVIEW 10026
// TRAY
#define EVERYTHING_IPC_ID_TRAY_NEW_SEARCH_WINDOW 40001
#define EVERYTHING_IPC_ID_TRAY_CONNECT_TO_ETP_SERVER 40004
#define EVERYTHING_IPC_ID_TRAY_OPTIONS 40005
#define EVERYTHING_IPC_ID_TRAY_EXIT 40006
#define EVERYTHING_IPC_ID_TRAY_SHOW_SEARCH_WINDOW 40007
#define EVERYTHING_IPC_ID_TRAY_TOGGLE_SEARCH_WINDOW 40008
// FILE
#define EVERYTHING_IPC_ID_FILE_NEW_WINDOW 40010
#define EVERYTHING_IPC_ID_FILE_CLOSE 40011
#define EVERYTHING_IPC_ID_FILE_EXPORT 40012
#define EVERYTHING_IPC_ID_FILE_EXIT 40013
#define EVERYTHING_IPC_ID_FILE_OPEN_FILELIST 40014
#define EVERYTHING_IPC_ID_FILE_CLOSE_FILELIST 40015
// EDIT
#define EVERYTHING_IPC_ID_EDIT_CUT 40020
#define EVERYTHING_IPC_ID_EDIT_COPY 40021
#define EVERYTHING_IPC_ID_EDIT_PASTE 40022
#define EVERYTHING_IPC_ID_EDIT_SELECT_ALL 40023
#define EVERYTHING_IPC_ID_EDIT_INVERT_SELECTION 40029
// VIEW
#define EVERYTHING_IPC_ID_VIEW_ZOOM_IN 40030
#define EVERYTHING_IPC_ID_VIEW_ZOOM_OUT 40031
#define EVERYTHING_IPC_ID_VIEW_ZOOM_RESET 40032
#define EVERYTHING_IPC_ID_VIEW_TOGGLE_FULLSCREEN 40034
#define EVERYTHING_IPC_ID_VIEW_AUTO_FIT 40044
#define EVERYTHING_IPC_ID_VIEW_AUTO_SIZE_1 40045
#define EVERYTHING_IPC_ID_VIEW_AUTO_SIZE_2 40046
#define EVERYTHING_IPC_ID_VIEW_AUTO_SIZE_3 40047
#define EVERYTHING_IPC_ID_VIEW_REFRESH 40036
#define EVERYTHING_IPC_ID_VIEW_FILTERS 40035
#define EVERYTHING_IPC_ID_VIEW_SORT_BY_ASCENDING 40037
#define EVERYTHING_IPC_ID_VIEW_SORT_BY_DESCENDING 40038
#define EVERYTHING_IPC_ID_VIEW_STATUS_BAR 40039
#define EVERYTHING_IPC_ID_VIEW_GOTO_BACK 40040
#define EVERYTHING_IPC_ID_VIEW_GOTO_FORWARD 40041
#define EVERYTHING_IPC_ID_VIEW_ONTOP_NEVER 40042
#define EVERYTHING_IPC_ID_VIEW_ONTOP_ALWAYS 40043
#define EVERYTHING_IPC_ID_VIEW_ONTOP_WHILE_SEARCHING 40048
#define EVERYTHING_IPC_ID_VIEW_GOTO_HOME 40049
#define EVERYTHING_IPC_ID_VIEW_TOGGLE_LTR_RTL 40050
#define EVERYTHING_IPC_ID_VIEW_DETAILS 40051
#define EVERYTHING_IPC_ID_VIEW_MEDIUM_ICONS 40052
#define EVERYTHING_IPC_ID_VIEW_LARGE_ICONS 40053
#define EVERYTHING_IPC_ID_VIEW_EXTRA_LARGE_ICONS 40054
#define EVERYTHING_IPC_ID_VIEW_PREVIEW 40055
#define EVERYTHING_IPC_ID_VIEW_GOTO_SHOW_ALL_HISTORY 40056
#define EVERYTHING_IPC_ID_VIEW_INCREASE_THUMBNAIL_SIZE 40057
#define EVERYTHING_IPC_ID_VIEW_DECREASE_THUMBNAIL_SIZE 40058
#define EVERYTHING_IPC_ID_VIEW_SHOW_FILTERS 40096 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_HIDE_FILTERS 40097 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_SHOW_PREVIEW 40098 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_HIDE_PREVIEW 40099 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_SHOW_STATUS_BAR 40100 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_HIDE_STATUS_BAR 40101 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_DETAILS_NO_TOGGLE 40102 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_MEDIUM_ICONS_NO_TOGGLE 40103 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_LARGE_ICONS_NO_TOGGLE 40104 // Everything 1.4.1
#define EVERYTHING_IPC_ID_VIEW_EXTRA_LARGE_ICONS_NO_TOGGLE 40105 // Everything 1.4.1
// SEARCH
#define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_CASE 40060
#define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_WHOLE_WORD 40061
#define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_PATH 40062
#define EVERYTHING_IPC_ID_SEARCH_TOGGLE_REGEX 40063
#define EVERYTHING_IPC_ID_SEARCH_TOGGLE_MATCH_DIACRITICS 40066
#define EVERYTHING_IPC_ID_SEARCH_FILTER_ADD 40067
#define EVERYTHING_IPC_ID_SEARCH_FILTER_ORGANIZE 40068
#define EVERYTHING_IPC_ID_SEARCH_ADVANCED_SEARCH 40069
#define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_CASE 40106 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_WHOLE_WORD 40107 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_PATH 40108 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_ENABLE_REGEX 40109 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_ENABLE_MATCH_DIACRITICS 40110 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_CASE 40111 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_WHOLE_WORD 40112 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_PATH 40113 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_DISABLE_REGEX 40114 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_DISABLE_MATCH_DIACRITICS 40115 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_EVERYTHING 40116 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_AUDIO 40117 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_COMPRESSED 40118 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_DOCUMENT 40119 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_EXECUTABLE 40120 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_FOLDER 40121 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_PICTURE 40122 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_VIDEO 40123 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_AUDIO_NO_TOGGLE 40124 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_COMPRESSED_NO_TOGGLE 40125 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_DOCUMENT_NO_TOGGLE 40126 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_EXECUTABLE_NO_TOGGLE 40127 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_FOLDER_NO_TOGGLE 40128 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_PICTURE_NO_TOGGLE 40129 // Everything 1.4.1
#define EVERYTHING_IPC_ID_SEARCH_FILTER_VIDEO_NO_TOGGLE 40130 // Everything 1.4.1
// TOOLS
#define EVERYTHING_IPC_ID_TOOLS_CONNECT_TO_ETP_SERVER 40072
#define EVERYTHING_IPC_ID_TOOLS_DISCONNECT_FROM_ETP_SERVER 40073
#define EVERYTHING_IPC_ID_TOOLS_OPTIONS 40074
#define EVERYTHING_IPC_ID_TOOLS_CONSOLE 40075
#define EVERYTHING_IPC_ID_TOOLS_EDITOR 40076
// HELP
#define EVERYTHING_IPC_ID_HELP_VIEW_HELP_TOPICS 40080
#define EVERYTHING_IPC_ID_HELP_OPEN_EVERYTHING_WEBSITE 40081
#define EVERYTHING_IPC_ID_HELP_CHECK_FOR_UPDATES 40082
#define EVERYTHING_IPC_ID_HELP_ABOUT_EVERYTHING 40083
#define EVERYTHING_IPC_ID_HELP_SEARCH_SYNTAX 40084
#define EVERYTHING_IPC_ID_HELP_COMMAND_LINE_OPTIONS 40085
#define EVERYTHING_IPC_ID_HELP_REGEX_SYNTAX 40086
#define EVERYTHING_IPC_ID_HELP_DONATE 40087
// bookmarks
#define EVERYTHING_IPC_ID_BOOKMARK_ADD 40090
#define EVERYTHING_IPC_ID_BOOKMARK_ORGANIZE 40091
#define EVERYTHING_IPC_ID_BOOKMARK_START 44000
#define EVERYTHING_IPC_ID_BOOKMARK_END 45000 // exclusive
#define EVERYTHING_IPC_ID_FILTER_START 45000
#define EVERYTHING_IPC_ID_FILTER_END 46000 // exclusive
#define EVERYTHING_IPC_ID_VIEW_GOTO_START 46000
#define EVERYTHING_IPC_ID_VIEW_GOTO_END 47000 // exclusive
// files
#define EVERYTHING_IPC_ID_FILE_OPEN 41000
#define EVERYTHING_IPC_ID_FILE_OPEN_NEW 41048
#define EVERYTHING_IPC_ID_FILE_OPEN_WITH 41049
#define EVERYTHING_IPC_ID_FILE_EDIT 41050
#define EVERYTHING_IPC_ID_FILE_PLAY 41051
#define EVERYTHING_IPC_ID_FILE_PRINT 41052
#define EVERYTHING_IPC_ID_FILE_PREVIEW 41053
#define EVERYTHING_IPC_ID_FILE_PRINT_TO 41054
#define EVERYTHING_IPC_ID_FILE_RUN_AS 41055
#define EVERYTHING_IPC_ID_FILE_OPEN_WITH_DEFAULT_VERB 41056
#define EVERYTHING_IPC_ID_FILE_OPEN_AND_CLOSE 41057
#define EVERYTHING_IPC_ID_FILE_EXPLORE_PATH 41002
#define EVERYTHING_IPC_ID_FILE_OPEN_PATH 41003
#define EVERYTHING_IPC_ID_FILE_DELETE 41004
#define EVERYTHING_IPC_ID_FILE_PERMANENTLY_DELETE 41005
#define EVERYTHING_IPC_ID_FILE_RENAME 41006
#define EVERYTHING_IPC_ID_FILE_COPY_FULL_PATH_AND_NAME 41007
#define EVERYTHING_IPC_ID_FILE_COPY_PATH 41008
#define EVERYTHING_IPC_ID_FILE_PROPERTIES 41009
#define EVERYTHING_IPC_ID_FILE_READ_EXTENDED_INFORMATION 41064
#define EVERYTHING_IPC_ID_FILE_CREATE_SHORTCUT 41065
#define EVERYTHING_IPC_ID_FILE_SET_RUN_COUNT 41068
#define EVERYTHING_IPC_ID_FILE_COPY_NAME 41011
#define EVERYTHING_IPC_ID_FILE_OPEN_AND_DO_NOT_CLOSE 41076
// result list
#define EVERYTHING_IPC_ID_RESULT_LIST_EXPLORE 41001
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS 41010
#define EVERYTHING_IPC_ID_RESULT_LIST_AUTOFIT_COLUMNS 41012
#define EVERYTHING_IPC_ID_RESULT_LIST_DOWN 41018
#define EVERYTHING_IPC_ID_RESULT_LIST_UP 41019
#define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_UP 41020
#define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_DOWN 41021
#define EVERYTHING_IPC_ID_RESULT_LIST_START 41022
#define EVERYTHING_IPC_ID_RESULT_LIST_END 41023
#define EVERYTHING_IPC_ID_RESULT_LIST_DOWN_EXTEND 41024
#define EVERYTHING_IPC_ID_RESULT_LIST_UP_EXTEND 41025
#define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_UP_EXTEND 41026
#define EVERYTHING_IPC_ID_RESULT_LIST_PAGE_DOWN_EXTEND 41027
#define EVERYTHING_IPC_ID_RESULT_LIST_START_EXTEND 41028
#define EVERYTHING_IPC_ID_RESULT_LIST_END_EXTEND 41029
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_DOWN 41030
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_UP 41031
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_UP 41032
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_DOWN 41033
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_START 41034
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_END 41035
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_LEFT 41036
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_RIGHT 41037
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_LEFT 41038
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_RIGHT 41039
#define EVERYTHING_IPC_ID_RESULT_LIST_SELECT_FOCUS 41040
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_FOCUS_SELECTION 41041
#define EVERYTHING_IPC_ID_RESULT_LIST_CONTEXT_MENU 41046
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_DOWN_EXTEND 41058
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_UP_EXTEND 41059
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_UP_EXTEND 41060
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_PAGE_DOWN_EXTEND 41061
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_START_EXTEND 41062
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_END_EXTEND 41063
#define EVERYTHING_IPC_ID_RESULT_LIST_AUTOFIT 41066
#define EVERYTHING_IPC_ID_RESULT_LIST_COPY_CSV 41067
#define EVERYTHING_IPC_ID_RESULT_LIST_LEFT_EXTEND 41070
#define EVERYTHING_IPC_ID_RESULT_LIST_RIGHT_EXTEND 41071
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_LEFT_EXTEND 41072
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_RIGHT_EXTEND 41073
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_MOST_RUN 41074
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_LAST_RUN 41075
#define EVERYTHING_IPC_ID_RESULT_LIST_LEFT 41079 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_RIGHT 41080 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_LEFT 41081 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_FOCUS_RIGHT 41082 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_LEFT_SCROLL_ONLY 41083 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_RIGHT_SCROLL_ONLY 41084 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_LEFT_SCROLL_ONLY 41085 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_SCROLL_PAGE_RIGHT_SCROLL_ONLY 41086 // Everything 1.4.1
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_NAME 41300
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_PATH 41301
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_SIZE 41302
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_EXTENSION 41303
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_TYPE 41304
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_MODIFIED 41305
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_CREATED 41306
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_ATTRIBUTES 41307
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_FILE_LIST_FILENAME 41308
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_RUN_COUNT 41309
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_RECENTLY_CHANGED 41310
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_ACCESSED 41311
#define EVERYTHING_IPC_ID_RESULT_LIST_SORT_BY_DATE_RUN 41312
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_NAME_COLUMN 41400
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_PATH_COLUMN 41401
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_SIZE_COLUMN 41402
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_EXTENSION_COLUMN 41403
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_TYPE_COLUMN 41404
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_MODIFIED_COLUMN 41405
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_CREATED_COLUMN 41406
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_ATTRIBUTES_COLUMN 41407
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_FILE_LIST_FILENAME_COLUMN 41408
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_RUN_COUNT_COLUMN 41409
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_RECENTLY_CHANGED_COLUMN 41410
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_ACCESSED_COLUMN 41411
#define EVERYTHING_IPC_ID_RESULT_LIST_TOGGLE_DATE_RUN_COLUMN 41412
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_NAME_COLUMN_TO_FIT 41600
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_PATH_COLUMN_TO_FIT 41601
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_SIZE_COLUMN_TO_FIT 41602
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_EXTENSION_COLUMN_TO_FIT 41603
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_TYPE_COLUMN_TO_FIT 41604
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_MODIFIED_COLUMN_TO_FIT 41605
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_CREATED_COLUMN_TO_FIT 41606
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_ATTRIBUTES_COLUMN_TO_FIT 41607
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_FILE_LIST_FILENAME_COLUMN_TO_FIT 41608
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_RUN_COUNT_COLUMN_TO_FIT 41609
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_RECENTLY_CHANGED_COLUMN_TO_FIT 41610
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_ACCESSED_COLUMN_TO_FIT 41611
#define EVERYTHING_IPC_ID_RESULT_LIST_SIZE_DATE_RUN_COLUMN_TO_FIT 41612
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB01 41500
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB02 41501
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB03 41502
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB04 41503
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB05 41504
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB06 41505
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB07 41506
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB08 41507
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB09 41508
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB10 41509
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB11 41510
#define EVERYTHING_IPC_ID_FILE_CUSTOM_VERB12 41511
// search
#define EVERYTHING_IPC_ID_SEARCH_EDIT_FOCUS 42000
#define EVERYTHING_IPC_ID_SEARCH_EDIT_WORD_DELETE_TO_START 42019
#define EVERYTHING_IPC_ID_SEARCH_EDIT_AUTO_COMPLETE 42020
#define EVERYTHING_IPC_ID_SEARCH_EDIT_SHOW_SEARCH_HISTORY 42021
#define EVERYTHING_IPC_ID_SEARCH_EDIT_SHOW_ALL_SEARCH_HISTORY 42022
#define EVERYTHING_IPC_ID_TRAY_EDITOR 41700
#define EVERYTHING_IPC_ID_TRAY_OPEN_FILELIST 41701
#define EVERYTHING_IPC_ID_INDEX_UPDATE_ALL_FOLDERS_NOW 41800
#define EVERYTHING_IPC_ID_INDEX_FORCE_REBUILD 41801
// find the everything IPC window
#define EVERYTHING_IPC_WNDCLASSW L"EVERYTHING_TASKBAR_NOTIFICATION"
#define EVERYTHING_IPC_WNDCLASSA "EVERYTHING_TASKBAR_NOTIFICATION"
// an Everything search window
#define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSW L"EVERYTHING"
#define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSA "EVERYTHING"
// this global window message is sent to all top level windows when everything starts.
#define EVERYTHING_IPC_CREATEDW L"EVERYTHING_IPC_CREATED"
#define EVERYTHING_IPC_CREATEDA "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
#define EVERYTHING_IPC_MATCHACCENTS 0x00000010 // match diacritic marks
#define EVERYTHING_IPC_MATCHDIACRITICS 0x00000010 // match diacritic marks
#define EVERYTHING_IPC_MATCHPREFIX 0x00000020 // match prefix (Everything 1.5)
#define EVERYTHING_IPC_MATCHSUFFIX 0x00000040 // match suffix (Everything 1.5)
#define EVERYTHING_IPC_IGNOREPUNCTUATION 0x00000080 // ignore punctuation (Everything 1.5)
#define EVERYTHING_IPC_IGNOREWHITESPACE 0x00000100 // ignore white-space (Everything 1.5)
// item flags
#define EVERYTHING_IPC_FOLDER 0x00000001 // The item is a folder. (it's a file if not set)
#define EVERYTHING_IPC_DRIVE 0x00000002 // the file or folder is a drive/root.
#define EVERYTHING_IPC_ROOT 0x00000002 // the file or folder is a root.
typedef struct EVERYTHING_IPC_COMMAND_LINE
{
DWORD show_command; // MUST be one of the SW_* ShowWindow() commands
// null terminated variable sized command line text in UTF-8.
BYTE command_line_text[1];
}EVERYTHING_IPC_COMMAND_LINE;
// the WM_COPYDATA message for a query.
#define EVERYTHING_IPC_COPYDATA_COMMAND_LINE_UTF8 0 // Send a EVERYTHING_IPC_COMMAND_LINE structure.
#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_ITEMA *)(item))->path_offset)
#define EVERYTHING_IPC_ITEMPATHW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->path_offset)
#pragma pack (push,1)
//
// Varible sized query struct sent to everything.
//
// sent in the form of a WM_COPYDATA 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 TCHAR plus the length of the search string in bytes plus
// one TCHAR 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) + wcslen(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_COPYDATA 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.
// only 32bits are required to store a window handle. (even on x64)
DWORD reply_hwnd;
// the value to set the dwData member in the COPYDATASTRUCT struct
// sent by Everything when the query is complete.
DWORD reply_copydata_message;
// search flags (see EVERYTHING_IPC_MATCHCASE | EVERYTHING_IPC_MATCHWHOLEWORD | EVERYTHING_IPC_MATCHPATH)
DWORD search_flags;
// only return results after 'offset' results (0 to return from the first result)
// useful for scrollable lists
DWORD offset;
// the number of results to return
// zero to return no results
// EVERYTHING_IPC_ALLRESULTS to return ALL results
DWORD max_results;
// null terminated string. variable lengthed search string buffer.
WCHAR search_string[1];
}EVERYTHING_IPC_QUERYW;
// ASCII version
typedef struct EVERYTHING_IPC_QUERYA
{
// the window that will receive the new results.
// only 32bits are required to store a window handle. (even on x64)
DWORD reply_hwnd;
// the value to set the dwData member in the COPYDATASTRUCT struct
// sent by Everything when the query is complete.
DWORD reply_copydata_message;
// search flags (see EVERYTHING_IPC_MATCHCASE | EVERYTHING_IPC_MATCHWHOLEWORD | EVERYTHING_IPC_MATCHPATH)
DWORD search_flags;
// only return results after 'offset' results (0 to return from the first result)
// useful for scrollable lists
DWORD offset;
// the number of results to return
// zero to return no results
// EVERYTHING_IPC_ALLRESULTS to return ALL results
DWORD max_results;
// null terminated string. variable lengthed search string buffer.
CHAR 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;
// variable lengthed 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;
// variable lengthed item list.
// use numitems to determine the actual number of items available.
EVERYTHING_IPC_ITEMA items[1];
}EVERYTHING_IPC_LISTA;
#pragma pack (pop)
#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
#define EVERYTHING_IPC_WNDCLASS EVERYTHING_IPC_WNDCLASSW
#define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSW
#define EVERYTHING_IPC_CREATED EVERYTHING_IPC_CREATEDW
#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
#define EVERYTHING_IPC_WNDCLASS EVERYTHING_IPC_WNDCLASSA
#define EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASS EVERYTHING_IPC_SEARCH_CLIENT_WNDCLASSA
#define EVERYTHING_IPC_CREATED EVERYTHING_IPC_CREATEDA
#endif
// the WM_COPYDATA message for a query.
// requires Everything 1.4.1
#define EVERYTHING_IPC_COPYDATA_QUERY2A 17
#define EVERYTHING_IPC_COPYDATA_QUERY2W 18
#define EVERYTHING_IPC_SORT_NAME_ASCENDING 1
#define EVERYTHING_IPC_SORT_NAME_DESCENDING 2
#define EVERYTHING_IPC_SORT_PATH_ASCENDING 3
#define EVERYTHING_IPC_SORT_PATH_DESCENDING 4
#define EVERYTHING_IPC_SORT_SIZE_ASCENDING 5
#define EVERYTHING_IPC_SORT_SIZE_DESCENDING 6
#define EVERYTHING_IPC_SORT_EXTENSION_ASCENDING 7
#define EVERYTHING_IPC_SORT_EXTENSION_DESCENDING 8
#define EVERYTHING_IPC_SORT_TYPE_NAME_ASCENDING 9
#define EVERYTHING_IPC_SORT_TYPE_NAME_DESCENDING 10
#define EVERYTHING_IPC_SORT_DATE_CREATED_ASCENDING 11
#define EVERYTHING_IPC_SORT_DATE_CREATED_DESCENDING 12
#define EVERYTHING_IPC_SORT_DATE_MODIFIED_ASCENDING 13
#define EVERYTHING_IPC_SORT_DATE_MODIFIED_DESCENDING 14
#define EVERYTHING_IPC_SORT_ATTRIBUTES_ASCENDING 15
#define EVERYTHING_IPC_SORT_ATTRIBUTES_DESCENDING 16
#define EVERYTHING_IPC_SORT_FILE_LIST_FILENAME_ASCENDING 17
#define EVERYTHING_IPC_SORT_FILE_LIST_FILENAME_DESCENDING 18
#define EVERYTHING_IPC_SORT_RUN_COUNT_ASCENDING 19
#define EVERYTHING_IPC_SORT_RUN_COUNT_DESCENDING 20
#define EVERYTHING_IPC_SORT_DATE_RECENTLY_CHANGED_ASCENDING 21
#define EVERYTHING_IPC_SORT_DATE_RECENTLY_CHANGED_DESCENDING 22
#define EVERYTHING_IPC_SORT_DATE_ACCESSED_ASCENDING 23
#define EVERYTHING_IPC_SORT_DATE_ACCESSED_DESCENDING 24
#define EVERYTHING_IPC_SORT_DATE_RUN_ASCENDING 25
#define EVERYTHING_IPC_SORT_DATE_RUN_DESCENDING 26
#define EVERYTHING_IPC_QUERY2_REQUEST_NAME 0x00000001
#define EVERYTHING_IPC_QUERY2_REQUEST_PATH 0x00000002
#define EVERYTHING_IPC_QUERY2_REQUEST_FULL_PATH_AND_NAME 0x00000004
#define EVERYTHING_IPC_QUERY2_REQUEST_EXTENSION 0x00000008
#define EVERYTHING_IPC_QUERY2_REQUEST_SIZE 0x00000010
#define EVERYTHING_IPC_QUERY2_REQUEST_DATE_CREATED 0x00000020
#define EVERYTHING_IPC_QUERY2_REQUEST_DATE_MODIFIED 0x00000040
#define EVERYTHING_IPC_QUERY2_REQUEST_DATE_ACCESSED 0x00000080
#define EVERYTHING_IPC_QUERY2_REQUEST_ATTRIBUTES 0x00000100
#define EVERYTHING_IPC_QUERY2_REQUEST_FILE_LIST_FILE_NAME 0x00000200
#define EVERYTHING_IPC_QUERY2_REQUEST_RUN_COUNT 0x00000400
#define EVERYTHING_IPC_QUERY2_REQUEST_DATE_RUN 0x00000800
#define EVERYTHING_IPC_QUERY2_REQUEST_DATE_RECENTLY_CHANGED 0x00001000
#define EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_NAME 0x00002000
#define EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_PATH 0x00004000
#define EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_FULL_PATH_AND_NAME 0x00008000
#define EVERYTHING_IPC_FILE_INFO_FILE_SIZE 1
#define EVERYTHING_IPC_FILE_INFO_FOLDER_SIZE 2
#define EVERYTHING_IPC_FILE_INFO_DATE_CREATED 3
#define EVERYTHING_IPC_FILE_INFO_DATE_MODIFIED 4
#define EVERYTHING_IPC_FILE_INFO_DATE_ACCESSED 5
#define EVERYTHING_IPC_FILE_INFO_ATTRIBUTES 6
#pragma pack (push,1)
//
// Varible sized query struct sent to everything.
//
// sent in the form of a WM_COPYDATA message with EVERYTHING_IPC_COPYDATA_QUERY2 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 TCHAR plus the length of the search string in bytes plus
// one TCHAR for the null terminator.
//
// 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_COPYDATA message with the dwData value you specify.
//
// Everything will return TRUE if successful.
// returns FALSE if not supported.
//
// If you query with EVERYTHING_IPC_COPYDATA_QUERYW, the results sent from Everything will be Unicode.
//
// ASCII version
typedef struct EVERYTHING_IPC_QUERY2
{
// the window that will receive the new results.
// only 32bits are required to store a window handle. (even on x64)
DWORD reply_hwnd;
// the value to set the dwData member in the COPYDATASTRUCT struct
// sent by Everything when the query is complete.
DWORD reply_copydata_message;
// search flags (see EVERYTHING_IPC_MATCHCASE | EVERYTHING_IPC_MATCHWHOLEWORD | EVERYTHING_IPC_MATCHPATH)
DWORD search_flags;
// only return results after 'offset' results (0 to return from the first result)
// useful for scrollable lists
DWORD offset;
// the number of results to return
// zero to return no results
// EVERYTHING_IPC_ALLRESULTS to return ALL results
DWORD max_results;
// request types.
// one or more of EVERYTHING_IPC_QUERY2_REQUEST_* types.
DWORD request_flags;
// sort type, set to one of EVERYTHING_IPC_SORT_* types.
// set to EVERYTHING_IPC_SORT_NAME_ASCENDING for the best performance (there will never be a performance hit when sorting by name ascending).
// Other sorts will also be instant if the corresponding fast sort is enabled from Tools -> Options -> Indexes.
DWORD sort_type;
// followed by null terminated search.
// TCHAR search_string[1];
}EVERYTHING_IPC_QUERY2;
typedef struct EVERYTHING_IPC_ITEM2
{
// item flags one of (EVERYTHING_IPC_FOLDER|EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_ROOT)
DWORD flags;
// offset from the start of the EVERYTHING_IPC_LIST2 struct to the data content
DWORD data_offset;
// data found at data_offset
// if EVERYTHING_IPC_QUERY2_REQUEST_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text.
// if EVERYTHING_IPC_QUERY2_REQUEST_PATH was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text.
// if EVERYTHING_IPC_QUERY2_REQUEST_FULL_PATH_AND_NAME was set in request_flags, DWORD name_length (excluding the null terminator); followed by null terminated text.
// if EVERYTHING_IPC_QUERY2_REQUEST_SIZE was set in request_flags, LARGE_INTERGER size;
// if EVERYTHING_IPC_QUERY2_REQUEST_EXTENSION was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text;
// if EVERYTHING_IPC_QUERY2_REQUEST_TYPE_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text;
// if EVERYTHING_IPC_QUERY2_REQUEST_DATE_CREATED was set in request_flags, FILETIME date;
// if EVERYTHING_IPC_QUERY2_REQUEST_DATE_MODIFIED was set in request_flags, FILETIME date;
// if EVERYTHING_IPC_QUERY2_REQUEST_DATE_ACCESSED was set in request_flags, FILETIME date;
// if EVERYTHING_IPC_QUERY2_REQUEST_ATTRIBUTES was set in request_flags, DWORD attributes;
// if EVERYTHING_IPC_QUERY2_REQUEST_FILELIST_FILENAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text;
// if EVERYTHING_IPC_QUERY2_REQUEST_RUN_COUNT was set in request_flags, DWORD run_count;
// if EVERYTHING_IPC_QUERY2_REQUEST_DATE_RUN was set in request_flags, FILETIME date;
// if EVERYTHING_IPC_QUERY2_REQUEST_DATE_RECENTLY_CHANGED was set in request_flags, FILETIME date;
// if EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; ** = *, *text* = highlighted text
// if EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_PATH was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; ** = *, *text* = highlighted text
// if EVERYTHING_IPC_QUERY2_REQUEST_HIGHLIGHTED_FULL_PATH_AND_NAME was set in request_flags, DWORD name_length in characters (excluding the null terminator); followed by null terminated text; ** = *, *text* = highlighted text
}EVERYTHING_IPC_ITEM2;
typedef struct EVERYTHING_IPC_LIST2
{
// number of items found.
DWORD totitems;
// the number of items available.
DWORD numitems;
// index offset of the first result in the item list.
DWORD offset;
// valid request types.
DWORD request_flags;
// this sort type.
// one of EVERYTHING_IPC_SORT_* types.
// maybe different to requested sort type.
DWORD sort_type;
// items follow.
// EVERYTHING_IPC_ITEM2 items[numitems]
// item data follows.
}EVERYTHING_IPC_LIST2;
#pragma pack (pop)
// Get the Run Count for a file, by filename.
// COPYDATASTRUCT cds;
// cds.dwData = EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA;
// cds.lpData = TEXT("C:\\folder\\file.txt");
// cds.cbData = size in bytes of cds.lpData including null terminator.
// SendMessage(everything_taskbar_notification_hwnd,WM_COPYDATA,(WPARAM)(HWND)notify_hwnd,(LPARAM)(COPYDATASTRUCT *)&cds);
#define EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA 19
#define EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTW 20
#pragma pack (push,1)
typedef struct EVERYTHING_IPC_RUN_HISTORY
{
DWORD run_count;
// null terminated ansi/wchar filename follows.
// TCHAR filename[];
}EVERYTHING_IPC_RUN_HISTORY;
#pragma pack (pop)
// Set the Run Count by one for a file, by filename.
// COPYDATASTRUCT cds;
// cds.dwData = EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA;
// cds.lpData = (EVERYTHING_IPC_RUN_HISTORY *)run_history;
// cds.cbData = size in bytes of cds.lpData including null terminator.
// SendMessage(everything_taskbar_notification_hwnd,WM_COPYDATA,(WPARAM)(HWND)notify_hwnd,(LPARAM)(COPYDATASTRUCT *)&cds);
#define EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTA 21
#define EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTW 22
// Increment the Run Count by one for a file, by filename.
// COPYDATASTRUCT cds;
// cds.dwData = EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA;
// cds.lpData = TEXT("C:\\folder\\file.txt");
// cds.cbData = size in bytes of cds.lpData including null terminator.
// SendMessage(everything_taskbar_notification_hwnd,WM_COPYDATA,(WPARAM)(HWND)notify_hwnd,(LPARAM)(COPYDATASTRUCT *)&cds);
#define EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTA 23
#define EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTW 24
#ifdef UNICODE
#define EVERYTHING_IPC_COPYDATA_QUERY2 EVERYTHING_IPC_COPYDATA_QUERY2W
#else
#define EVERYTHING_IPC_COPYDATA_QUERY2 EVERYTHING_IPC_COPYDATA_QUERY2A
#endif
// end extern C
#ifdef __cplusplus
}
#endif
#endif // _EVERYTHING_H_
================================================
FILE: EverythingSDK/src/Everything.c
================================================
//
// Copyright (C) 2016 David Carpenter
//
// Permission is hereby granted, free of charge,
// to any person obtaining a copy of this software
// and associated documentation files (the "Software"),
// to deal in the Software without restriction,
// including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Notes:
// this project builds the dll (visual studio will also build the lib for us)
// we declare all exported calls to __stdcall, so theres no need to set the default calling standard.
// disable warnings
#pragma warning(disable : 4996) // deprecation
#define EVERYTHINGUSERAPI __declspec(dllexport)
// include
#include "../include/Everything.h"
#include "../include/Everything_IPC.h"
// return copydata code
#define _EVERYTHING_COPYDATA_QUERYREPLY 0
#define _EVERYTHING_MSGFLT_ALLOW 1
#define ES_BUF_SIZE MAX_PATH
typedef struct _EVERYTHING_tagCHANGEFILTERSTRUCT
{
DWORD cbSize;
DWORD ExtStatus;
}_EVERYTHING_CHANGEFILTERSTRUCT, *_EVERYTHING_PCHANGEFILTERSTRUCT;
static void *_Everything_Alloc(DWORD size);
static void _Everything_Free(void *ptr);
static void _Everything_Initialize(void);
static void _Everything_Lock(void);
static void _Everything_Unlock(void);
static DWORD _Everything_StringLengthA(LPCSTR start);
static DWORD _Everything_StringLengthW(LPCWSTR start);
static BOOL EVERYTHINGAPI _Everything_Query(void);
static BOOL _Everything_ShouldUseVersion2(void);
static BOOL _Everything_SendIPCQuery(void);
static BOOL _Everything_SendIPCQuery2(HWND everything_hwnd);
static void _Everything_FreeLists(void);
static BOOL _Everything_IsValidResultIndex(DWORD dwIndex);
static void *_Everything_GetRequestData(DWORD dwIndex,DWORD dwRequestType);
static BOOL _Everything_IsSchemeNameW(LPCWSTR s);
static BOOL _Everything_IsSchemeNameA(LPCSTR s);
static void _Everything_ChangeWindowMessageFilter(HWND hwnd);
static BOOL _Everything_GetResultRequestData(DWORD dwIndex,DWORD dwRequestType,void *data,int size);
static LPCWSTR _Everything_GetResultRequestStringW(DWORD dwIndex,DWORD dwRequestType);
static LPCSTR _Everything_GetResultRequestStringA(DWORD dwIndex,DWORD dwRequestType);
static BOOL _Everything_SendAPIBoolCommand(int command,LPARAM lParam);
static DWORD _Everything_SendAPIDwordCommand(int command,LPARAM lParam);
static LRESULT _Everything_SendCopyData(int command,const void *data,int size);
static LRESULT WINAPI _Everything_window_proc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
// internal state
static BOOL _Everything_MatchPath = FALSE;
static BOOL _Everything_MatchCase = FALSE;
static BOOL _Everything_MatchWholeWord = FALSE;
static BOOL _Everything_Regex = FALSE;
static DWORD _Everything_LastError = FALSE;
static DWORD _Everything_Max = EVERYTHING_IPC_ALLRESULTS;
static DWORD _Everything_Offset = 0;
static DWORD _Everything_Sort = EVERYTHING_SORT_NAME_ASCENDING;
static DWORD _Everything_RequestFlags = EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME;
static BOOL _Everything_IsUnicodeQuery = FALSE;
static DWORD _Everything_QueryVersion = 0;
static BOOL _Everything_IsUnicodeSearch = FALSE;
static void *_Everything_Search = NULL; // wchar or char
static EVERYTHING_IPC_LIST2 *_Everything_List2 = NULL;
static void *_Everything_List = NULL; // EVERYTHING_IPC_LISTW or EVERYTHING_IPC_LISTA
static volatile BOOL _Everything_Initialized = FALSE;
static volatile LONG _Everything_InterlockedCount = 0;
static CRITICAL_SECTION _Everything_cs;
static HWND _Everything_ReplyWindow = 0;
static DWORD _Everything_ReplyID = 0;
static wchar_t _Everything_InstanceName[256] = {0}; // The maximum length for lpszClassName is 256
static BOOL (WINAPI *_Everything_pChangeWindowMessageFilterEx)(HWND hWnd,UINT message,DWORD action,_EVERYTHING_PCHANGEFILTERSTRUCT pChangeFilterStruct) = 0;
static HANDLE _Everything_user32_hdll = NULL;
static BOOL _Everything_GotChangeWindowMessageFilterEx = FALSE;
void es_wbuf_cat(wchar_t* buf, int max, const wchar_t* s)
{
const wchar_t* p;
wchar_t* d;
max--;
d = buf;
while (max)
{
if (!*d) break;
d++;
max--;
}
p = s;
while (max)
{
if (!*p) break;
*d++ = *p;
p++;
max--;
}
*d = 0;
}
void es_wstring_cat(wchar_t* buf, const wchar_t* s)
{
es_wbuf_cat(buf, ES_BUF_SIZE, s);
}
static HWND es_find_instance_window()
{
wchar_t window_class[ES_BUF_SIZE];
*window_class = 0;
es_wstring_cat(window_class, EVERYTHING_IPC_WNDCLASSW);
if (*_Everything_InstanceName != 0)
{
if (wcslen(_Everything_InstanceName) >
((sizeof(window_class)
- sizeof(EVERYTHING_IPC_WNDCLASSW)
- sizeof(L"_(")
- sizeof(L")"))
/ sizeof(wchar_t))
+ 3) // 0
{
// Not enough space
return 0;
}
es_wstring_cat(window_class, L"_(");
es_wstring_cat(window_class, _Everything_InstanceName);
es_wstring_cat(window_class, L")");
}
HWND everything_hwnd = FindWindow(window_class, 0);
return everything_hwnd;
}
static void _Everything_Initialize(void)
{
if (!_Everything_Initialized)
{
if (InterlockedIncrement(&_Everything_InterlockedCount) == 1)
{
// do the initialization..
InitializeCriticalSection(&_Everything_cs);
_Everything_Initialized = 1;
}
else
{
// wait for initialization by other thread.
while (!_Everything_Initialized) Sleep(0);
}
}
}
static void _Everything_Lock(void)
{
_Everything_Initialize();
EnterCriticalSection(&_Everything_cs);
}
static void _Everything_Unlock(void)
{
LeaveCriticalSection(&_Everything_cs);
}
// avoid other libs
static DWORD _Everything_StringLengthA(LPCSTR start)
{
register LPCSTR s;
s = start;
while(*s)
{
s++;
}
return (DWORD)(s-start);
}
static DWORD _Everything_StringLengthW(LPCWSTR start)
{
register LPCWSTR s;
s = start;
while(*s)
{
s++;
}
return (DWORD)(s-start);
}
void EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString)
{
DWORD len;
_Everything_Lock();
if (_Everything_Search)
{
_Everything_Free(_Everything_Search);
}
len = _Everything_StringLengthW(lpString) + 1;
_Everything_Search = _Everything_Alloc(len*sizeof(WCHAR));
if (_Everything_Search)
{
CopyMemory(_Everything_Search,lpString,len*sizeof(WCHAR));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
_Everything_IsUnicodeSearch = 1;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString)
{
DWORD size;
_Everything_Lock();
if (_Everything_Search)
{
_Everything_Free(_Everything_Search);
}
size = _Everything_StringLengthA(lpString) + 1;
_Everything_Search = _Everything_Alloc(size);
if (_Everything_Search)
{
CopyMemory(_Everything_Search,lpString,size);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
_Everything_IsUnicodeSearch = 0;
_Everything_Unlock();
}
LPCSTR EVERYTHINGAPI Everything_GetSearchA(void)
{
LPCSTR ret;
_Everything_Lock();
if (_Everything_Search)
{
if (_Everything_IsUnicodeSearch)
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = NULL;
}
else
{
ret = (LPCSTR)_Everything_Search;
}
}
else
{
ret = "";
}
_Everything_Unlock();
return ret;
}
LPCWSTR EVERYTHINGAPI Everything_GetSearchW(void)
{
LPCWSTR ret;
_Everything_Lock();
if (_Everything_Search)
{
if (!_Everything_IsUnicodeSearch)
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = NULL;
}
else
{
ret = (LPCWSTR)_Everything_Search;
}
}
else
{
ret = L"";
}
_Everything_Unlock();
return ret;
}
void EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable)
{
_Everything_Lock();
_Everything_MatchPath = bEnable;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable)
{
_Everything_Lock();
_Everything_MatchCase = bEnable;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable)
{
_Everything_Lock();
_Everything_MatchWholeWord = bEnable;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetRegex(BOOL bEnable)
{
_Everything_Lock();
_Everything_Regex = bEnable;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetMax(DWORD dwMax)
{
_Everything_Lock();
_Everything_Max = dwMax;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset)
{
_Everything_Lock();
_Everything_Offset = dwOffset;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetSort(DWORD dwSort)
{
_Everything_Lock();
_Everything_Sort = dwSort;
_Everything_Unlock();
}
EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetRequestFlags(DWORD dwRequestFlags)
{
_Everything_Lock();
_Everything_RequestFlags = dwRequestFlags;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd)
{
_Everything_Lock();
_Everything_ReplyWindow = hWnd;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_SetReplyID(DWORD dwId)
{
_Everything_Lock();
_Everything_ReplyID = dwId;
_Everything_Unlock();
}
BOOL EVERYTHINGAPI Everything_GetMatchPath(void)
{
BOOL ret;
_Everything_Lock();
ret = _Everything_MatchPath;
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_GetMatchCase(void)
{
BOOL ret;
_Everything_Lock();
ret = _Everything_MatchCase;
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(void)
{
BOOL ret;
_Everything_Lock();
ret = _Everything_MatchWholeWord;
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_GetRegex(void)
{
BOOL ret;
_Everything_Lock();
ret = _Everything_Regex;
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetMax(void)
{
DWORD ret;
_Everything_Lock();
ret = _Everything_Max;
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetOffset(void)
{
DWORD ret;
_Everything_Lock();
ret = _Everything_Offset;
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetSort(void)
{
DWORD ret;
_Everything_Lock();
ret = _Everything_Sort;
_Everything_Unlock();
return ret;
}
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetRequestFlags(void)
{
DWORD ret;
_Everything_Lock();
ret = _Everything_RequestFlags;
_Everything_Unlock();
return ret;
}
HWND EVERYTHINGAPI Everything_GetReplyWindow(void)
{
HWND ret;
_Everything_Lock();
ret = _Everything_ReplyWindow;
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetReplyID(void)
{
DWORD ret;
_Everything_Lock();
ret = _Everything_ReplyID;
_Everything_Unlock();
return ret;
}
// custom window proc
static LRESULT WINAPI _Everything_window_proc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
case WM_COPYDATA:
{
COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam;
switch(cds->dwData)
{
case _EVERYTHING_COPYDATA_QUERYREPLY:
if (_Everything_QueryVersion == 2)
{
_Everything_FreeLists();
_Everything_List2 = _Everything_Alloc(cds->cbData);
if (_Everything_List2)
{
CopyMemory(_Everything_List2,cds->lpData,cds->cbData);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
PostQuitMessage(0);
}
else
if (_Everything_QueryVersion == 1)
{
_Everything_FreeLists();
_Everything_List = _Everything_Alloc(cds->cbData);
if (_Everything_List)
{
CopyMemory(_Everything_List,cds->lpData,cds->cbData);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
PostQuitMessage(0);
return TRUE;
}
break;
}
break;
}
}
return DefWindowProc(hwnd,msg,wParam,lParam);
}
// get the search length
static DWORD _Everything_GetSearchLengthW(void)
{
if (_Everything_Search)
{
if (_Everything_IsUnicodeSearch)
{
return _Everything_StringLengthW((LPCWSTR )_Everything_Search);
}
else
{
return MultiByteToWideChar(CP_ACP,0,(LPCSTR )_Everything_Search,-1,0,0);
}
}
return 0;
}
// get the search length
static DWORD _Everything_GetSearchLengthA(void)
{
if (_Everything_Search)
{
if (_Everything_IsUnicodeSearch)
{
return WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,0,0,0,0);
}
else
{
return _Everything_StringLengthA((LPCSTR )_Everything_Search);
}
}
return 0;
}
// get the search length
static void _Everything_GetSearchTextW(LPWSTR wbuf)
{
DWORD wlen;
if (_Everything_Search)
{
wlen = _Everything_GetSearchLengthW();
if (_Everything_IsUnicodeSearch)
{
CopyMemory(wbuf,_Everything_Search,(wlen+1) * sizeof(WCHAR));
return;
}
else
{
MultiByteToWideChar(CP_ACP,0,(LPCSTR )_Everything_Search,-1,wbuf,wlen+1);
return;
}
}
*wbuf = 0;
}
// get the search length
static void _Everything_GetSearchTextA(LPSTR buf)
{
DWORD len;
if (_Everything_Search)
{
len = _Everything_GetSearchLengthA();
if (_Everything_IsUnicodeSearch)
{
WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,buf,len+1,0,0);
return;
}
else
{
CopyMemory(buf,_Everything_Search,len+1);
return;
}
}
*buf = 0;
}
void EVERYTHINGAPI Everything_SetInstanceName(LPCWSTR name)
{
if (name == 0)
{
*_Everything_InstanceName = 0;
return;
}
if (wcslen(name) > (sizeof(_Everything_InstanceName) / sizeof(wchar_t)))
{
return;
}
wcscpy(_Everything_InstanceName, name);
}
static DWORD EVERYTHINGAPI _Everything_query_thread_proc(void *param)
{
HWND everything_hwnd;
everything_hwnd = es_find_instance_window();
if (everything_hwnd)
{
WNDCLASSEX wcex;
HWND hwnd;
MSG msg;
int ret;
ZeroMemory(&wcex,sizeof(WNDCLASSEX));
wcex.cbSize = sizeof(WNDCLASSEX);
if (!GetClassInfoEx(GetModuleHandle(0),TEXT("EVERYTHING_DLL"),&wcex))
{
ZeroMemory(&wcex,sizeof(WNDCLASSEX));
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.hInstance = GetModuleHandle(0);
wcex.lpfnWndProc = _Everything_window_proc;
wcex.lpszClassName = TEXT("EVERYTHING_DLL");
if (!RegisterClassEx(&wcex))
{
_Everything_LastError = EVERYTHING_ERROR_REGISTERCLASSEX;
return 0;
}
}
//FIXME: this should be static so we keep file info cached.
hwnd = CreateWindow(
TEXT("EVERYTHING_DLL"),
TEXT(""),
0,
0,0,0,0,
0,0,GetModuleHandle(0),0);
if (hwnd)
{
_Everything_ChangeWindowMessageFilter(hwnd);
_Everything_ReplyWindow = hwnd;
_Everything_ReplyID = _EVERYTHING_COPYDATA_QUERYREPLY;
if (_Everything_SendIPCQuery())
{
// message pump
loop:
WaitMessage();
// update windows
while(PeekMessage(&msg,NULL,0,0,0))
{
ret = (DWORD)GetMessage(&msg,0,0,0);
if (ret == -1) goto exit;
if (!ret) goto exit;
// let windows handle it.
TranslateMessage(&msg);
DispatchMessage(&msg);
}
goto loop;
}
exit:
// get result from window.
DestroyWindow(hwnd);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_CREATEWINDOW;
}
}
else
{
// the everything window was not found.
// we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and
// wait for Everything to post this message to all top level windows when its up and running.
_Everything_LastError = EVERYTHING_ERROR_IPC;
}
return 0;
}
static BOOL EVERYTHINGAPI _Everything_Query(void)
{
HANDLE hthread;
DWORD thread_id;
// reset the error flag.
_Everything_LastError = 0;
hthread = CreateThread(0,0,_Everything_query_thread_proc,0,0,&thread_id);
if (hthread)
{
WaitForSingleObject(hthread,INFINITE);
CloseHandle(hthread);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_CREATETHREAD;
}
return (_Everything_LastError == 0)?TRUE:FALSE;
}
static BOOL _Everything_SendIPCQuery2(HWND everything_hwnd)
{
BOOL ret;
DWORD size;
EVERYTHING_IPC_QUERY2 *query;
// try version 2.
if (_Everything_IsUnicodeQuery)
{
// unicode
size = sizeof(EVERYTHING_IPC_QUERY2) + ((_Everything_GetSearchLengthW() + 1) * sizeof(WCHAR));
}
else
{
// ansi
size = sizeof(EVERYTHING_IPC_QUERY2) + ((_Everything_GetSearchLengthA() + 1) * sizeof(char));
}
// alloc
query = _Everything_Alloc(size);
if (query)
{
COPYDATASTRUCT cds;
query->max_results = _Everything_Max;
query->offset = _Everything_Offset;
query->reply_copydata_message = _Everything_ReplyID;
query->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0);
query->reply_hwnd = (DWORD)(DWORD_PTR)_Everything_ReplyWindow;
query->sort_type = (DWORD)_Everything_Sort;
query->request_flags = (DWORD)_Everything_RequestFlags;
if (_Everything_IsUnicodeQuery)
{
_Everything_GetSearchTextW((LPWSTR)(query + 1));
}
else
{
_Everything_GetSearchTextA((LPSTR)(query + 1));
}
cds.cbData = size;
cds.dwData = _Everything_IsUnicodeQuery ? EVERYTHING_IPC_COPYDATA_QUERY2W : EVERYTHING_IPC_COPYDATA_QUERY2A;
cds.lpData = query;
if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)_Everything_ReplyWindow,(LPARAM)&cds))
{
// successful.
ret = TRUE;
}
else
{
// no ipc
_Everything_LastError = EVERYTHING_ERROR_IPC;
ret = FALSE;
}
// get result from window.
_Everything_Free(query);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
ret = FALSE;
}
return ret;
}
static BOOL _Everything_ShouldUseVersion2(void)
{
if (_Everything_RequestFlags != (EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME))
{
return TRUE;
}
if (_Everything_Sort != EVERYTHING_SORT_NAME_ASCENDING)
{
return TRUE;
}
// just use version 1
return FALSE;
}
static BOOL _Everything_SendIPCQuery(void)
{
HWND everything_hwnd;
BOOL ret;
// find the everything ipc window.
everything_hwnd = es_find_instance_window();
if (everything_hwnd)
{
_Everything_QueryVersion = 2;
// try version 2 first (if we specified some non-version 1 request flags or sort)
if ((_Everything_ShouldUseVersion2()) && (_Everything_SendIPCQuery2(everything_hwnd)))
{
// sucessful.
ret = TRUE;
}
else
{
DWORD len;
DWORD size;
void *query;
// try version 1.
if (_Everything_IsUnicodeQuery)
{
// unicode
len = _Everything_GetSearchLengthW();
size = sizeof(EVERYTHING_IPC_QUERYW) - sizeof(WCHAR) + len*sizeof(WCHAR) + sizeof(WCHAR);
}
else
{
// ansi
len = _Everything_GetSearchLengthA();
size = sizeof(EVERYTHING_IPC_QUERYA) - sizeof(char) + (len*sizeof(char)) + sizeof(char);
}
// alloc
query = _Everything_Alloc(size);
if (query)
{
COPYDATASTRUCT cds;
if (_Everything_IsUnicodeQuery)
{
((EVERYTHING_IPC_QUERYW *)query)->max_results = _Everything_Max;
((EVERYTHING_IPC_QUERYW *)query)->offset = _Everything_Offset;
((EVERYTHING_IPC_QUERYW *)query)->reply_copydata_message = _Everything_ReplyID;
((EVERYTHING_IPC_QUERYW *)query)->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0);
((EVERYTHING_IPC_QUERYW *)query)->reply_hwnd = (DWORD)(DWORD_PTR)_Everything_ReplyWindow;
_Everything_GetSearchTextW(((EVERYTHING_IPC_QUERYW *)query)->search_string);
}
else
{
((EVERYTHING_IPC_QUERYA *)query)->max_results = _Everything_Max;
((EVERYTHING_IPC_QUERYA *)query)->offset = _Everything_Offset;
((EVERYTHING_IPC_QUERYA *)query)->reply_copydata_message = _Everything_ReplyID;
((EVERYTHING_IPC_QUERYA *)query)->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0);
((EVERYTHING_IPC_QUERYA *)query)->reply_hwnd = (DWORD)(DWORD_PTR)_Everything_ReplyWindow;
_Everything_GetSearchTextA(((EVERYTHING_IPC_QUERYA *)query)->search_string);
}
cds.cbData = size;
cds.dwData = _Everything_IsUnicodeQuery ? EVERYTHING_IPC_COPYDATAQUERYW : EVERYTHING_IPC_COPYDATAQUERYA;
cds.lpData = query;
_Everything_QueryVersion = 1;
if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)_Everything_ReplyWindow,(LPARAM)&cds))
{
// sucessful.
ret = TRUE;
}
else
{
// no ipc
_Everything_LastError = EVERYTHING_ERROR_IPC;
ret = FALSE;
}
// get result from window.
_Everything_Free(query);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
ret = FALSE;
}
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_IPC;
ret = FALSE;
}
return ret;
}
BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait)
{
BOOL ret;
_Everything_Lock();
_Everything_IsUnicodeQuery = FALSE;
if (bWait)
{
ret = _Everything_Query();
}
else
{
ret = _Everything_SendIPCQuery();
}
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait)
{
BOOL ret;
_Everything_Lock();
_Everything_IsUnicodeQuery = TRUE;
if (bWait)
{
ret = _Everything_Query();
}
else
{
ret = _Everything_SendIPCQuery();
}
_Everything_Unlock();
return ret;
}
static int __cdecl _Everything_CompareA(const void *a,const void *b)
{
int i;
i = stricmp(EVERYTHING_IPC_ITEMPATHA(_Everything_List,a),EVERYTHING_IPC_ITEMPATHA(_Everything_List,b));
if (!i)
{
return stricmp(EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,b));
}
else
if (i > 0)
{
return 1;
}
else
{
return -1;
}
}
static int __cdecl _Everything_CompareW(const void *a,const void *b)
{
int i;
i = wcsicmp(EVERYTHING_IPC_ITEMPATHW(_Everything_List,a),EVERYTHING_IPC_ITEMPATHW(_Everything_List,b));
if (!i)
{
return wcsicmp(EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,b));
}
else
if (i > 0)
{
return 1;
}
else
{
return -1;
}
}
void EVERYTHINGAPI Everything_SortResultsByPath(void)
{
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
qsort(((EVERYTHING_IPC_LISTW *)_Everything_List)->items,((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMW),_Everything_CompareW);
}
else
{
qsort(((EVERYTHING_IPC_LISTA *)_Everything_List)->items,((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMA),_Everything_CompareA);
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
}
//FIXME://TODO: sort list2
_Everything_Unlock();
}
DWORD EVERYTHINGAPI Everything_GetLastError(void)
{
DWORD ret;
_Everything_Lock();
ret = _Everything_LastError;
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetNumFileResults(void)
{
DWORD ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numfiles;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numfiles;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = 0;
}
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetNumFolderResults(void)
{
DWORD ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numfolders;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numfolders;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = 0;
}
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetNumResults(void)
{
DWORD ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems;
}
}
else
if (_Everything_List2)
{
ret = _Everything_List2->numitems;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = 0;
}
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetTotFileResults(void)
{
DWORD ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfiles;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfiles;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = 0;
}
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetTotFolderResults(void)
{
DWORD ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfolders;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfolders;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = 0;
}
_Everything_Unlock();
return ret;
}
DWORD EVERYTHINGAPI Everything_GetTotResults(void)
{
DWORD ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totitems;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totitems;
}
}
else
if (_Everything_List2)
{
ret = _Everything_List2->totitems;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = 0;
}
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_IsVolumeResult(DWORD dwIndex)
{
BOOL ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
if (_Everything_IsUnicodeQuery)
{
ret = (((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex].flags & EVERYTHING_IPC_DRIVE) ? TRUE : FALSE;
}
else
{
ret = (((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex].flags & EVERYTHING_IPC_DRIVE) ? TRUE : FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
if (_Everything_List2)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = (((EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1))[dwIndex].flags & EVERYTHING_IPC_DRIVE) ? TRUE : FALSE;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = FALSE;
}
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_IsFolderResult(DWORD dwIndex)
{
BOOL ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
if (_Everything_IsUnicodeQuery)
{
ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER) ? TRUE : FALSE;
}
else
{
ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER) ? TRUE : FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
if (_Everything_List2)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = (((EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1))[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? TRUE : FALSE;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = FALSE;
}
_Everything_Unlock();
return ret;
}
BOOL EVERYTHINGAPI Everything_IsFileResult(DWORD dwIndex)
{
BOOL ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
if (_Everything_IsUnicodeQuery)
{
ret = (((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? FALSE : TRUE;
}
else
{
ret = (((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? FALSE : TRUE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
if (_Everything_List2)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = (((EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1))[dwIndex].flags & (EVERYTHING_IPC_FOLDER)) ? FALSE : TRUE;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = FALSE;
}
_Everything_Unlock();
return ret;
}
LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(DWORD dwIndex)
{
LPCWSTR ret;
_Everything_Lock();
if ((_Everything_List) && (_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
if ((_Everything_List2) && (_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME);
if (ret)
{
// skip length in characters.
ret = (LPCWSTR)(((char *)ret) + sizeof(DWORD));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = NULL;
}
_Everything_Unlock();
return ret;
}
LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(DWORD dwIndex)
{
LPCSTR ret;
_Everything_Lock();
if ((_Everything_List) && (!_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
if ((_Everything_List2) && (!_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME);
if (ret)
{
// skip length in characters.
ret = (LPCSTR)(((char *)ret) + sizeof(DWORD));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = NULL;
}
_Everything_Unlock();
return ret;
}
LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(DWORD dwIndex)
{
LPCWSTR ret;
_Everything_Lock();
if ((_Everything_List) && (_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
if ((_Everything_List2) && (_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH);
if (ret)
{
// skip length in characters.
ret = (LPCWSTR)(((char *)ret) + sizeof(DWORD));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = NULL;
}
_Everything_Unlock();
return ret;
}
LPCSTR EVERYTHINGAPI Everything_GetResultPathA(DWORD dwIndex)
{
LPCSTR ret;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
if ((_Everything_List2) && (!_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
ret = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH);
if (ret)
{
// skip length in characters.
ret = (LPCSTR)(((char *)ret) + sizeof(DWORD));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = NULL;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = NULL;
}
_Everything_Unlock();
return ret;
}
// max is in chars
static DWORD _Everything_CopyW(LPWSTR buf,DWORD bufmax,DWORD catlen,LPCWSTR s)
{
DWORD wlen;
if (buf)
{
buf += catlen;
bufmax -= catlen;
}
wlen = _Everything_StringLengthW(s);
if (!wlen)
{
if (buf)
{
buf[wlen] = 0;
}
return catlen;
}
// terminate
if (wlen > bufmax-1) wlen = bufmax-1;
if (buf)
{
CopyMemory(buf,s,wlen*sizeof(WCHAR));
buf[wlen] = 0;
}
return wlen + catlen;
}
static DWORD _Everything_CopyA(LPSTR buf,DWORD max,DWORD catlen,LPCSTR s)
{
DWORD len;
if (buf)
{
buf += catlen;
max -= catlen;
}
len = _Everything_StringLengthA(s);
if (!len)
{
if (buf)
{
buf[len] = 0;
}
return catlen;
}
// terminate
if (len > max-1) len = max-1;
if (buf)
{
CopyMemory(buf,s,len*sizeof(char));
buf[len] = 0;
}
return len + catlen;
}
// max is in chars
static DWORD _Everything_CopyWFromA(LPWSTR buf,DWORD bufmax,DWORD catlen,LPCSTR s)
{
DWORD wlen;
if (buf)
{
buf += catlen;
bufmax -= catlen;
}
wlen = MultiByteToWideChar(CP_ACP,0,s,_Everything_StringLengthA(s),0,0);
if (!wlen)
{
if (buf)
{
buf[wlen] = 0;
}
return catlen;
}
// terminate
if (wlen > bufmax-1) wlen = bufmax-1;
if (buf)
{
MultiByteToWideChar(CP_ACP,0,s,_Everything_StringLengthA(s),buf,wlen);
buf[wlen] = 0;
}
return wlen + catlen;
}
static DWORD _Everything_CopyAFromW(LPSTR buf,DWORD max,DWORD catlen,LPCWSTR s)
{
DWORD len;
if (buf)
{
buf += catlen;
max -= catlen;
}
len = WideCharToMultiByte(CP_ACP,0,s,_Everything_StringLengthW(s),0,0,0,0);
if (!len)
{
if (buf)
{
buf[len] = 0;
}
return catlen;
}
// terminate
if (len > max-1) len = max-1;
if (buf)
{
WideCharToMultiByte(CP_ACP,0,s,_Everything_StringLengthW(s),buf,len,0,0);
buf[len] = 0;
}
return len + catlen;
}
DWORD EVERYTHINGAPI Everything_GetResultFullPathNameW(DWORD dwIndex,LPWSTR wbuf,DWORD wbuf_size_in_wchars)
{
DWORD len;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]));
if (len)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,_Everything_IsSchemeNameW(EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex])) ? L"/" : L"\\");
}
}
else
{
len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,0,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]));
if (len)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,_Everything_IsSchemeNameA(EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex])) ? L"/" : L"\\");
}
}
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]));
}
else
{
len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]));
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
}
}
else
if (_Everything_List2)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
const void *full_path_and_name;
full_path_and_name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME);
if (full_path_and_name)
{
// skip number of characters.
full_path_and_name = (void *)(((char *)full_path_and_name) + sizeof(DWORD));
// we got the full path and name already.
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,full_path_and_name);
}
else
{
len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,0,full_path_and_name);
}
}
else
{
const void *path;
path = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH);
if (path)
{
const void *name;
// skip number of characters.
path = (void *)(((char *)path) + sizeof(DWORD));
name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME);
if (name)
{
// skip number of characters.
name = (void *)(((char *)name) + sizeof(DWORD));
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,path);
if (len)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,_Everything_IsSchemeNameW(path) ? L"/" : L"\\");
}
}
else
{
len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,0,path);
if (len)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,_Everything_IsSchemeNameA(path) ? L"/" : L"\\");
}
}
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,name);
}
else
{
len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,name);
}
}
else
{
// name data not available.
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
}
}
else
{
// path data not available.
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
}
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L"");
}
_Everything_Unlock();
return len;
}
DWORD EVERYTHINGAPI Everything_GetResultFullPathNameA(DWORD dwIndex,LPSTR buf,DWORD bufsize)
{
DWORD len;
_Everything_Lock();
if (_Everything_List)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyAFromW(buf,bufsize,0,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]));
}
else
{
len = _Everything_CopyA(buf,bufsize,0,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]));
}
if (len)
{
len = _Everything_CopyA(buf,bufsize,len,_Everything_IsSchemeNameA(buf) ? "/" : "\\");
}
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[dwIndex]));
}
else
{
len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[dwIndex]));
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
len = _Everything_CopyA(buf,bufsize,0,"");
}
}
else
if (_Everything_List2)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
const void *full_path_and_name;
full_path_and_name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME);
if (full_path_and_name)
{
// skip number of characters.
full_path_and_name = (void *)(((char *)full_path_and_name) + sizeof(DWORD));
// we got the full path and name already.
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyAFromW(buf,bufsize,0,full_path_and_name);
}
else
{
len = _Everything_CopyA(buf,bufsize,0,full_path_and_name);
}
}
else
{
const void *path;
path = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_PATH);
if (path)
{
const void *name;
// skip number of characters.
path = (void *)(((char *)path) + sizeof(DWORD));
name = _Everything_GetRequestData(dwIndex,EVERYTHING_REQUEST_FILE_NAME);
if (name)
{
// skip number of characters.
name = (void *)(((char *)name) + sizeof(DWORD));
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyAFromW(buf,bufsize,0,path);
}
else
{
len = _Everything_CopyA(buf,bufsize,0,path);
}
if (len)
{
len = _Everything_CopyA(buf,bufsize,len,_Everything_IsSchemeNameA(buf) ? "/" : "\\");
}
if (_Everything_IsUnicodeQuery)
{
len = _Everything_CopyAFromW(buf,bufsize,len,name);
}
else
{
len = _Everything_CopyA(buf,bufsize,len,name);
}
}
else
{
// name data not available.
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
len = _Everything_CopyA(buf,bufsize,0,"");
}
}
else
{
// path data not available.
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
len = _Everything_CopyA(buf,bufsize,0,"");
}
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
len = _Everything_CopyA(buf,bufsize,0,"");
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
len = _Everything_CopyA(buf,bufsize,0,"");
}
_Everything_Unlock();
return len;
}
BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD dwId)
{
if (message == WM_COPYDATA)
{
COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam;
if (cds)
{
if ((cds->dwData == _Everything_ReplyID) && (cds->dwData == dwId))
{
if (_Everything_QueryVersion == 2)
{
_Everything_FreeLists();
_Everything_List2 = _Everything_Alloc(cds->cbData);
if (_Everything_List2)
{
_Everything_LastError = 0;
CopyMemory(_Everything_List2,cds->lpData,cds->cbData);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
return TRUE;
}
else
if (_Everything_QueryVersion == 1)
{
if (_Everything_IsUnicodeQuery)
{
_Everything_FreeLists();
_Everything_List = _Everything_Alloc(cds->cbData);
if (_Everything_List)
{
_Everything_LastError = 0;
CopyMemory(_Everything_List,cds->lpData,cds->cbData);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
return TRUE;
}
else
{
_Everything_FreeLists();
_Everything_List = _Everything_Alloc(cds->cbData);
if (_Everything_List)
{
_Everything_LastError = 0;
CopyMemory(_Everything_List,cds->lpData,cds->cbData);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
}
return TRUE;
}
}
}
}
}
return FALSE;
}
void EVERYTHINGAPI Everything_Reset(void)
{
_Everything_Lock();
if (_Everything_Search)
{
_Everything_Free(_Everything_Search);
_Everything_Search = 0;
}
_Everything_FreeLists();
// reset state
_Everything_MatchPath = FALSE;
_Everything_MatchCase = FALSE;
_Everything_MatchWholeWord = FALSE;
_Everything_Regex = FALSE;
_Everything_LastError = FALSE;
_Everything_Max = EVERYTHING_IPC_ALLRESULTS;
_Everything_Offset = 0;
_Everything_Sort = EVERYTHING_SORT_NAME_ASCENDING;
_Everything_RequestFlags = EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME;
_Everything_IsUnicodeQuery = FALSE;
_Everything_IsUnicodeSearch = FALSE;
_Everything_Unlock();
}
void EVERYTHINGAPI Everything_CleanUp(void)
{
Everything_Reset();
DeleteCriticalSection(&_Everything_cs);
_Everything_Initialized = 0;
}
static void *_Everything_Alloc(DWORD size)
{
return HeapAlloc(GetProcessHeap(),0,size);
}
static void _Everything_Free(void *ptr)
{
HeapFree(GetProcessHeap(),0,ptr);
}
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListSort(void)
{
DWORD dwSort;
_Everything_Lock();
dwSort = EVERYTHING_SORT_NAME_ASCENDING;
if (_Everything_List2)
{
dwSort = _Everything_List2->sort_type;
}
_Everything_Unlock();
return dwSort;
}
EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultListRequestFlags(void)
{
DWORD dwRequestFlags;
_Everything_Lock();
dwRequestFlags = EVERYTHING_REQUEST_PATH | EVERYTHING_REQUEST_FILE_NAME;
if (_Everything_List2)
{
dwRequestFlags = _Everything_List2->request_flags;
}
_Everything_Unlock();
return dwRequestFlags;
}
static void _Everything_FreeLists(void)
{
if (_Everything_List)
{
_Everything_Free(_Everything_List);
_Everything_List = 0;
}
if (_Everything_List2)
{
_Everything_Free(_Everything_List2);
_Everything_List2 = 0;
}
}
static BOOL _Everything_IsValidResultIndex(DWORD dwIndex)
{
if (dwIndex < 0)
{
return FALSE;
}
if (dwIndex >= Everything_GetNumResults())
{
return FALSE;
}
return TRUE;
}
// assumes _Everything_List2 and dwIndex are valid.
static void *_Everything_GetRequestData(DWORD dwIndex,DWORD dwRequestType)
{
char *p;
EVERYTHING_IPC_ITEM2 *items;
items = (EVERYTHING_IPC_ITEM2 *)(_Everything_List2 + 1);
p = ((char *)_Everything_List2) + items[dwIndex].data_offset;
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_FILE_NAME)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_FILE_NAME)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_PATH)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_PATH)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_EXTENSION)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_EXTENSION)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_SIZE)
{
if (dwRequestType == EVERYTHING_REQUEST_SIZE)
{
return p;
}
p += sizeof(LARGE_INTEGER);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_CREATED)
{
if (dwRequestType == EVERYTHING_REQUEST_DATE_CREATED)
{
return p;
}
p += sizeof(FILETIME);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_MODIFIED)
{
if (dwRequestType == EVERYTHING_REQUEST_DATE_MODIFIED)
{
return p;
}
p += sizeof(FILETIME);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_ACCESSED)
{
if (dwRequestType == EVERYTHING_REQUEST_DATE_ACCESSED)
{
return p;
}
p += sizeof(FILETIME);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_ATTRIBUTES)
{
if (dwRequestType == EVERYTHING_REQUEST_ATTRIBUTES)
{
return p;
}
p += sizeof(DWORD);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_FILE_LIST_FILE_NAME)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_FILE_LIST_FILE_NAME)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_RUN_COUNT)
{
if (dwRequestType == EVERYTHING_REQUEST_RUN_COUNT)
{
return p;
}
p += sizeof(DWORD);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_RUN)
{
if (dwRequestType == EVERYTHING_REQUEST_DATE_RUN)
{
return p;
}
p += sizeof(FILETIME);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED)
{
if (dwRequestType == EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED)
{
return p;
}
p += sizeof(FILETIME);
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_HIGHLIGHTED_PATH)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_HIGHLIGHTED_PATH)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
if (_Everything_List2->request_flags & EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME)
{
DWORD len;
if (dwRequestType == EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME)
{
return p;
}
len = *(DWORD *)p;
p += sizeof(DWORD);
if (_Everything_IsUnicodeQuery)
{
p += (len + 1) * sizeof(WCHAR);
}
else
{
p += (len + 1) * sizeof(CHAR);
}
}
return NULL;
}
static BOOL _Everything_IsSchemeNameW(LPCWSTR s)
{
LPCWSTR p;
p = s;
while(*p)
{
if (*p == ':')
{
p++;
if ((p[0] == '/') && (p[1] == '/'))
{
return TRUE;
}
break;
}
p++;
}
return FALSE;
}
static BOOL _Everything_IsSchemeNameA(LPCSTR s)
{
LPCSTR p;
p = s;
while(*p)
{
if (*p == ':')
{
p++;
if ((p[0] == '/') && (p[1] == '/'))
{
return TRUE;
}
break;
}
p++;
}
return FALSE;
}
static void _Everything_ChangeWindowMessageFilter(HWND hwnd)
{
if (!_Everything_GotChangeWindowMessageFilterEx)
{
// allow the everything window to send a reply.
_Everything_user32_hdll = LoadLibraryW(L"user32.dll");
if (_Everything_user32_hdll)
{
_Everything_pChangeWindowMessageFilterEx = (BOOL (WINAPI *)(HWND hWnd,UINT message,DWORD action,_EVERYTHING_PCHANGEFILTERSTRUCT pChangeFilterStruct))GetProcAddress(_Everything_user32_hdll,"ChangeWindowMessageFilterEx");
}
_Everything_GotChangeWindowMessageFilterEx = 1;
}
if (_Everything_GotChangeWindowMessageFilterEx)
{
if (_Everything_pChangeWindowMessageFilterEx)
{
_Everything_pChangeWindowMessageFilterEx(hwnd,WM_COPYDATA,_EVERYTHING_MSGFLT_ALLOW,0);
}
}
}
static LPCWSTR _Everything_GetResultRequestStringW(DWORD dwIndex,DWORD dwRequestType)
{
LPCWSTR str;
_Everything_Lock();
if ((_Everything_List2) && (_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
str = _Everything_GetRequestData(dwIndex,dwRequestType);
if (str)
{
// skip length in characters.
str = (LPCWSTR)(((char *)str) + sizeof(DWORD));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
str = NULL;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
str = NULL;
}
_Everything_Unlock();
return str;
}
static LPCSTR _Everything_GetResultRequestStringA(DWORD dwIndex,DWORD dwRequestType)
{
LPCSTR str;
_Everything_Lock();
if ((_Everything_List2) && (!_Everything_IsUnicodeQuery))
{
if (_Everything_IsValidResultIndex(dwIndex))
{
str = _Everything_GetRequestData(dwIndex,dwRequestType);
if (str)
{
// skip length in characters.
str = (LPCSTR)(((char *)str) + sizeof(DWORD));
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
str = NULL;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
str = NULL;
}
_Everything_Unlock();
return str;
}
static BOOL _Everything_GetResultRequestData(DWORD dwIndex,DWORD dwRequestType,void *data,int size)
{
BOOL ret;
_Everything_Lock();
if (_Everything_List2)
{
if (_Everything_IsValidResultIndex(dwIndex))
{
void *request_data;
request_data = _Everything_GetRequestData(dwIndex,dwRequestType);
if (request_data)
{
CopyMemory(data,request_data,size);
ret = TRUE;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDREQUEST;
ret = FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX;
ret = FALSE;
}
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = FALSE;
}
_Everything_Unlock();
return ret;
}
LPCWSTR EVERYTHINGAPI Everything_GetResultExtensionW(DWORD dwIndex)
{
return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_EXTENSION);
}
LPCSTR EVERYTHINGAPI Everything_GetResultExtensionA(DWORD dwIndex)
{
return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_EXTENSION);
}
BOOL EVERYTHINGAPI Everything_GetResultSize(DWORD dwIndex,LARGE_INTEGER *lpSize)
{
return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_SIZE,lpSize,sizeof(LARGE_INTEGER));
}
BOOL EVERYTHINGAPI Everything_GetResultDateCreated(DWORD dwIndex,FILETIME *lpDateCreated)
{
return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_CREATED,lpDateCreated,sizeof(FILETIME));
}
BOOL EVERYTHINGAPI Everything_GetResultDateModified(DWORD dwIndex,FILETIME *lpDateModified)
{
return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_MODIFIED,lpDateModified,sizeof(FILETIME));
}
BOOL EVERYTHINGAPI Everything_GetResultDateAccessed(DWORD dwIndex,FILETIME *lpDateAccessed)
{
return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_ACCESSED,lpDateAccessed,sizeof(FILETIME));
}
DWORD EVERYTHINGAPI Everything_GetResultAttributes(DWORD dwIndex)
{
DWORD dwAttributes;
if (_Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_ATTRIBUTES,&dwAttributes,sizeof(DWORD)))
{
return dwAttributes;
}
return INVALID_FILE_ATTRIBUTES;
}
LPCWSTR EVERYTHINGAPI Everything_GetResultFileListFileNameW(DWORD dwIndex)
{
return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_FILE_LIST_FILE_NAME);
}
LPCSTR EVERYTHINGAPI Everything_GetResultFileListFileNameA(DWORD dwIndex)
{
return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_FILE_LIST_FILE_NAME);
}
DWORD EVERYTHINGAPI Everything_GetResultRunCount(DWORD dwIndex)
{
DWORD dwRunCount;
if (_Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_RUN_COUNT,&dwRunCount,sizeof(DWORD)))
{
return dwRunCount;
}
return 0;
}
BOOL EVERYTHINGAPI Everything_GetResultDateRun(DWORD dwIndex,FILETIME *lpDateRun)
{
return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_RUN,lpDateRun,sizeof(FILETIME));
}
BOOL EVERYTHINGAPI Everything_GetResultDateRecentlyChanged(DWORD dwIndex,FILETIME *lpDateRecentlyChanged)
{
return _Everything_GetResultRequestData(dwIndex,EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED,lpDateRecentlyChanged,sizeof(FILETIME));
}
LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameW(DWORD dwIndex)
{
return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME);
}
LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFileNameA(DWORD dwIndex)
{
return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME);
}
LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedPathW(DWORD dwIndex)
{
return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_PATH);
}
LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedPathA(DWORD dwIndex)
{
return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_PATH);
}
LPCWSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameW(DWORD dwIndex)
{
return _Everything_GetResultRequestStringW(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME);
}
LPCSTR EVERYTHINGAPI Everything_GetResultHighlightedFullPathAndFileNameA(DWORD dwIndex)
{
return _Everything_GetResultRequestStringA(dwIndex,EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME);
}
static BOOL _Everything_SendAPIBoolCommand(int command,LPARAM lParam)
{
HWND everything_hwnd;
everything_hwnd = es_find_instance_window();
if (everything_hwnd)
{
_Everything_LastError = 0;
if (SendMessage(everything_hwnd,EVERYTHING_WM_IPC,command,lParam))
{
return TRUE;
}
else
{
return FALSE;
}
}
else
{
// the everything window was not found.
// we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and
// wait for Everything to post this message to all top level windows when its up and running.
_Everything_LastError = EVERYTHING_ERROR_IPC;
return FALSE;
}
}
static DWORD _Everything_SendAPIDwordCommand(int command,LPARAM lParam)
{
HWND everything_hwnd;
everything_hwnd = es_find_instance_window();
if (everything_hwnd)
{
_Everything_LastError = 0;
return (DWORD)SendMessage(everything_hwnd,EVERYTHING_WM_IPC,command,lParam);
}
else
{
// the everything window was not found.
// we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and
// wait for Everything to post this message to all top level windows when its up and running.
_Everything_LastError = EVERYTHING_ERROR_IPC;
return 0;
}
}
BOOL EVERYTHINGAPI Everything_IsDBLoaded(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_DB_LOADED,0);
}
BOOL EVERYTHINGAPI Everything_IsAdmin(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_ADMIN,0);
}
BOOL EVERYTHINGAPI Everything_IsAppData(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_APPDATA,0);
}
BOOL EVERYTHINGAPI Everything_RebuildDB(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_REBUILD_DB,0);
}
BOOL EVERYTHINGAPI Everything_UpdateAllFolderIndexes(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_UPDATE_ALL_FOLDER_INDEXES,0);
}
BOOL EVERYTHINGAPI Everything_SaveDB(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_SAVE_DB,0);
}
BOOL EVERYTHINGAPI Everything_SaveRunHistory(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_SAVE_RUN_HISTORY,0);
}
BOOL EVERYTHINGAPI Everything_DeleteRunHistory(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_DELETE_RUN_HISTORY,0);
}
DWORD EVERYTHINGAPI Everything_GetMajorVersion(void)
{
return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_MAJOR_VERSION,0);
}
DWORD EVERYTHINGAPI Everything_GetMinorVersion(void)
{
return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_MINOR_VERSION,0);
}
DWORD EVERYTHINGAPI Everything_GetRevision(void)
{
return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_REVISION,0);
}
DWORD EVERYTHINGAPI Everything_GetBuildNumber(void)
{
return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_BUILD_NUMBER,0);
}
DWORD EVERYTHINGAPI Everything_GetTargetMachine(void)
{
return _Everything_SendAPIDwordCommand(EVERYTHING_IPC_GET_TARGET_MACHINE,0);
}
BOOL EVERYTHINGAPI Everything_Exit(void)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_EXIT,0);
}
BOOL EVERYTHINGAPI Everything_IsFastSort(DWORD sortType)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_FAST_SORT,(LPARAM)sortType);
}
BOOL EVERYTHINGAPI Everything_IsFileInfoIndexed(DWORD fileInfoType)
{
return _Everything_SendAPIBoolCommand(EVERYTHING_IPC_IS_FILE_INFO_INDEXED,(LPARAM)fileInfoType);
}
static LRESULT _Everything_SendCopyData(int command,const void *data,int size)
{
HWND everything_hwnd;
everything_hwnd = es_find_instance_window();
if (everything_hwnd)
{
COPYDATASTRUCT cds;
cds.cbData = size;
cds.dwData = command;
cds.lpData = (void *)data;
return SendMessage(everything_hwnd,WM_COPYDATA,0,(LPARAM)&cds);
}
else
{
// the everything window was not found.
// we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and
// wait for Everything to post this message to all top level windows when its up and running.
_Everything_LastError = EVERYTHING_ERROR_IPC;
return FALSE;
}
}
DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameW(LPCWSTR lpFileName)
{
return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTW,lpFileName,(_Everything_StringLengthW(lpFileName) + 1) * sizeof(WCHAR));
}
DWORD EVERYTHINGAPI Everything_GetRunCountFromFileNameA(LPCSTR lpFileName)
{
return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_GET_RUN_COUNTA,lpFileName,_Everything_StringLengthA(lpFileName) + 1);
}
BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameW(LPCWSTR lpFileName,DWORD dwRunCount)
{
EVERYTHING_IPC_RUN_HISTORY *run_history;
DWORD len;
BOOL ret;
len = _Everything_StringLengthW(lpFileName);
run_history = _Everything_Alloc(sizeof(EVERYTHING_IPC_RUN_HISTORY) + ((len + 1) * sizeof(WCHAR)));
if (run_history)
{
run_history->run_count = dwRunCount;
CopyMemory(run_history + 1,lpFileName,((len + 1) * sizeof(WCHAR)));
if (_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTW,run_history,sizeof(EVERYTHING_IPC_RUN_HISTORY) + ((len + 1) * sizeof(WCHAR))))
{
ret = TRUE;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = FALSE;
}
_Everything_Free(run_history);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
ret = FALSE;
}
return ret;
}
BOOL EVERYTHINGAPI Everything_SetRunCountFromFileNameA(LPCSTR lpFileName,DWORD dwRunCount)
{
EVERYTHING_IPC_RUN_HISTORY *run_history;
DWORD len;
BOOL ret;
len = _Everything_StringLengthA(lpFileName);
run_history = _Everything_Alloc(sizeof(EVERYTHING_IPC_RUN_HISTORY) + (len + 1));
if (run_history)
{
run_history->run_count = dwRunCount;
CopyMemory(run_history + 1,lpFileName,(len + 1));
if (_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_SET_RUN_COUNTA,run_history,sizeof(EVERYTHING_IPC_RUN_HISTORY) + (len + 1)))
{
ret = TRUE;
}
else
{
_Everything_LastError = EVERYTHING_ERROR_INVALIDCALL;
ret = FALSE;
}
_Everything_Free(run_history);
}
else
{
_Everything_LastError = EVERYTHING_ERROR_MEMORY;
ret = FALSE;
}
return ret;
}
DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameW(LPCWSTR lpFileName)
{
return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTW,lpFileName,(_Everything_StringLengthW(lpFileName) + 1) * sizeof(WCHAR));
}
DWORD EVERYTHINGAPI Everything_IncRunCountFromFileNameA(LPCSTR lpFileName)
{
return (DWORD)_Everything_SendCopyData(EVERYTHING_IPC_COPYDATA_INC_RUN_COUNTA,lpFileName,_Everything_StringLengthA(lpFileName) + 1);
}
================================================
FILE: EverythingSDK/src/Everything64.def
================================================
LIBRARY Everything64
EXPORTS
Everything_GetLastError
Everything_SetSearchA
Everything_SetSearchW
Everything_SetMatchPath
Everything_SetMatchCase
Everything_SetMatchWholeWord
Everything_SetRegex
Everything_SetMax
Everything_SetOffset
Everything_SetReplyID
Everything_SetReplyWindow
Everything_GetSearchA
Everything_GetSearchW
Everything_GetMatchPath
Everything_GetMatchCase
Everything_GetMatchWholeWord
Everything_GetRegex
Everything_GetMax
Everything_GetOffset
Everything_GetReplyID
Everything_GetReplyWindow
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
Everything_CleanUp
Everything_SetSort
Everything_SetRequestFlags
Everything_GetSort
Everything_GetRequestFlags
Everything_GetResultListSort
Everything_GetResultListRequestFlags
Everything_GetResultExtensionW
Everything_GetResultExtensionA
Everything_GetResultSize
Everything_GetResultDateCreated
Everything_GetResultDateModified
Everything_GetResultDateAccessed
Everything_GetResultAttributes
Everything_GetResultFileListFileNameW
Everything_GetResultFileListFileNameA
Everything_GetResultRunCount
Everything_GetResultDateRun
Everything_GetResultDateRecentlyChanged
Everything_GetResultHighlightedFileNameW
Everything_GetResultHighlightedFileNameA
Everything_GetResultHighlightedPathW
Everything_GetResultHighlightedPathA
Everything_GetResultHighlightedFullPathAndFileNameW
Everything_GetResultHighlightedFullPathAndFileNameA
Everything_GetMajorVersion
Everything_GetMinorVersion
Everything_GetRevision
Everything_GetBuildNumber
Everything_Exit
Everything_IsDBLoaded
Everything_IsAdmin
Everything_IsAppData
Everything_RebuildDB
Everything_UpdateAllFolderIndexes
Everything_SaveDB
Everything_SaveRunHistory
Everything_DeleteRunHistory
Everything_GetTargetMachine
Everything_IsFastSort
Everything_IsFileInfoIndexed
Everything_GetRunCountFromFileNameW
Everything_GetRunCountFromFileNameA
Everything_SetRunCountFromFileNameW
Everything_SetRunCountFromFileNameA
Everything_IncRunCountFromFileNameW
Everything_IncRunCountFromFileNameA
Everything_SetInstanceName
================================================
FILE: EverythingToolbar/Behaviors/FlowDirectionAwareness.cs
================================================
using System.Globalization;
using System.Windows;
using Microsoft.Xaml.Behaviors;
namespace EverythingToolbar.Behaviors
{
public class FlowDirectionAwareness : Behavior
{
protected override void OnAttached()
{
base.OnAttached();
UpdateFlowDirection();
}
private void UpdateFlowDirection()
{
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
{
AssociatedObject.FlowDirection = FlowDirection.RightToLeft;
}
else
{
AssociatedObject.FlowDirection = FlowDirection.LeftToRight;
}
}
}
}
================================================
FILE: EverythingToolbar/Behaviors/ThemeAwareness.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Media;
using EverythingToolbar.Helpers;
using Microsoft.Xaml.Behaviors;
using NLog;
using Windows.UI.ViewManagement;
using Color = Windows.UI.Color;
namespace EverythingToolbar.Behaviors
{
public enum Theme
{
Dark,
Light,
}
public class ResourcesChangedEventArgs : EventArgs
{
public Theme NewTheme { get; set; }
}
public class ThemeAwareness : Behavior
{
public static event EventHandler ResourceChanged;
private readonly List _addedDictionaries = new();
private UISettings _settings;
private static readonly RegistryEntry SystemThemeRegistryEntry = new(
"HKEY_CURRENT_USER",
@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize",
"SystemUsesLightTheme"
);
private static readonly ILogger Logger = ToolbarLogger.GetLogger();
protected override void OnAttached()
{
base.OnAttached();
if (AssociatedObject.IsLoaded)
{
AutoApplyTheme();
}
else
{
AssociatedObject.Loaded += (_, _) =>
{
AutoApplyTheme();
};
}
}
public ThemeAwareness()
{
var systemThemeWatcher = new RegistryWatcher(SystemThemeRegistryEntry);
systemThemeWatcher.OnChangeValue += newValue =>
{
Dispatcher.Invoke(() =>
{
var theme = GetThemeFromRegistryValue((int)newValue);
ApplyTheme(theme);
});
};
try
{
_settings = new UISettings();
_settings.ColorValuesChanged += (sender, args) =>
{
Dispatcher.Invoke(AutoApplyTheme);
};
}
catch
{
Logger.Info("Could not apply accent color automatically.");
}
ToolbarSettings.User.PropertyChanged += OnSettingsChanged;
}
private void OnSettingsChanged(object sender, PropertyChangedEventArgs e)
{
if (
e.PropertyName
is nameof(ToolbarSettings.User.ItemTemplate)
or nameof(ToolbarSettings.User.ThemeOverride)
or nameof(ToolbarSettings.User.ForceWin10Behavior)
)
{
AutoApplyTheme();
}
}
private Theme GetThemeFromRegistryValue(int registryValue)
{
if (ToolbarSettings.User.ThemeOverride.ToLower() == "light")
{
return Theme.Light;
}
if (ToolbarSettings.User.ThemeOverride.ToLower() == "dark")
{
return Theme.Dark;
}
return registryValue == 1 ? Theme.Light : Theme.Dark;
}
private void AutoApplyTheme()
{
var themeValue = (int)SystemThemeRegistryEntry.GetValue(0);
var theme = GetThemeFromRegistryValue(themeValue);
ApplyTheme(theme);
}
private void ApplyTheme(Theme theme)
{
foreach (var dict in _addedDictionaries)
{
AssociatedObject.Resources.MergedDictionaries.Remove(dict);
}
_addedDictionaries.Clear();
var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var themeLocation = assemblyLocation;
if (Utils.GetWindowsVersion() >= Utils.WindowsVersion.Windows11)
themeLocation = Path.Combine(themeLocation, "Themes", "Win11");
else
themeLocation = Path.Combine(themeLocation, "Themes", "Win10");
// Apply all control styles contained in "Controls" subdirectory
var controlsLocation = new DirectoryInfo(Path.Combine(themeLocation, "Controls"));
foreach (var file in controlsLocation.GetFiles("*.xaml"))
AddResource(file.FullName);
// Apply color scheme according to Windows theme
var themeFileName = theme == Theme.Light ? "Light.xaml" : "Dark.xaml";
AddResource(Path.Combine(themeLocation, themeFileName));
// Apply ItemTemplate style
var dataTemplateLocation = Path.Combine(
assemblyLocation,
"ItemTemplates",
ToolbarSettings.User.ItemTemplate + ".xaml"
);
AddResource(
dataTemplateLocation,
fallbackPath: Path.Combine(assemblyLocation, "ItemTemplates", "Normal.xaml")
);
// Apply accent color
if (_settings != null)
{
if (theme == Theme.Light)
SetAccentColor(GetBrush(_settings.GetColorValue(UIColorType.AccentDark1)));
else
SetAccentColor(GetBrush(_settings.GetColorValue(UIColorType.AccentLight2)));
}
else
{
SetAccentColor(new SolidColorBrush(Colors.DimGray));
}
// Notify resource change
ResourceChanged?.Invoke(this, new ResourcesChangedEventArgs { NewTheme = theme });
}
private void AddResource(string path, string fallbackPath = null)
{
if (!File.Exists(path))
{
Logger.Error("Could not find resource file " + path);
if (fallbackPath != null)
AddResource(fallbackPath);
return;
}
var resDict = new ResourceDictionary { Source = new Uri(path) };
AssociatedObject.Resources.MergedDictionaries.Add(resDict);
_addedDictionaries.Add(resDict);
}
private void SetAccentColor(SolidColorBrush brush)
{
var resDict = new ResourceDictionary();
resDict.Add("AccentColor", brush);
AssociatedObject.Resources.MergedDictionaries.Add(resDict);
_addedDictionaries.Add(resDict);
}
private static SolidColorBrush GetBrush(Color color)
{
return new SolidColorBrush(System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B));
}
}
}
================================================
FILE: EverythingToolbar/Behaviors/WpfUiBehavior.cs
================================================
using System.Windows;
using EverythingToolbar.Helpers;
using Microsoft.Xaml.Behaviors;
using Wpf.Ui.Appearance;
namespace EverythingToolbar.Behaviors
{
public class WpfUiBehavior : Behavior
{
private static readonly RegistryEntry SystemThemeRegistryEntry = new(
"HKEY_CURRENT_USER",
@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize",
"AppsUseLightTheme"
);
protected override void OnAttached()
{
base.OnAttached();
if (AssociatedObject.IsLoaded)
AutoApplyTheme();
else
AssociatedObject.Loaded += (_, _) =>
{
AutoApplyTheme();
};
}
private void ApplyTheme(Theme theme)
{
ApplicationThemeManager.Apply(theme == Theme.Light ? ApplicationTheme.Light : ApplicationTheme.Dark);
ApplicationThemeManager.Apply(AssociatedObject);
}
private void AutoApplyTheme()
{
var themeValue = SystemThemeRegistryEntry.GetValue(0) as int? ?? 0;
var theme = GetThemeFromRegistryValue(themeValue);
ApplyTheme(theme);
}
private Theme GetThemeFromRegistryValue(int registryValue)
{
if (ToolbarSettings.User.ThemeOverride.ToLower() == "light")
{
return Theme.Light;
}
if (ToolbarSettings.User.ThemeOverride.ToLower() == "dark")
{
return Theme.Dark;
}
return registryValue == 1 ? Theme.Light : Theme.Dark;
}
}
}
================================================
FILE: EverythingToolbar/Controls/AcrylicWindow.cs
================================================
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Shell;
using EverythingToolbar.Behaviors;
using EverythingToolbar.Helpers;
namespace EverythingToolbar.Controls
{
public class AcrylicWindow : Window
{
[DllImport("DWMAPI")]
private static extern IntPtr DwmExtendFrameIntoClientArea(IntPtr hwnd, ref Margins margins);
[DllImport("DWMAPI")]
private static extern IntPtr DwmSetWindowAttribute(
IntPtr hwnd,
DwmWindowAttribute attribute,
ref int value,
uint dataSize
);
[DllImport("User32")]
private static extern bool SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
[DllImport("User32")]
private static extern bool SetWindowPos(
IntPtr hwnd,
IntPtr hwndInsertAfter,
int x,
int y,
int width,
int height,
SetWindowPosFlags flags
);
[StructLayout(LayoutKind.Sequential)]
private struct WindowCompositionAttributeData
{
public WindowCompositionAttribute Attribute;
public IntPtr DataPointer;
public uint DataSize;
}
[StructLayout(LayoutKind.Sequential)]
private struct AccentPolicy
{
public AccentState AccentState;
public AccentFlags AccentFlags;
public int GradientColor;
public int AnimationId;
}
[StructLayout(LayoutKind.Sequential)]
private struct Margins
{
public int LeftWidth;
public int RightWidth;
public int TopHeight;
public int BottomHeight;
}
private enum AccentState
{
Disabled,
EnableGradient = 1,
EnableTransparent = 2,
EnableBlurBehind = 3,
EnableAcrylicBlurBehind = 4,
EnableHostBackdrop = 5,
InvalidState = 6,
}
[Flags]
private enum AccentFlags
{
None = 0,
ExtendSize = 0x4,
LeftBorder = 0x20,
TopBorder = 0x40,
RightBorder = 0x80,
BottomBorder = 0x100,
AllBorder = LeftBorder | TopBorder | RightBorder | BottomBorder,
}
private enum WindowCompositionAttribute
{
WcaAccentPolicy = 19,
}
private enum DwmWindowAttribute
{
WINDOW_CORNER_PREFERENCE = 33,
}
private enum WindowCorner
{
Default = 0,
DoNotRound = 1,
Round = 2,
RoundSmall = 3,
}
[Flags]
private enum SetWindowPosFlags
{
ASYNCWINDOWPOS = 16384,
DEFERERASE = 8192,
DRAWFRAME = 32,
FRAMECHANGED = 32,
HIDEWINDOW = 128,
NOACTIVATE = 16,
NOCOPYBITS = 256,
NOMOVE = 2,
NOOWNERZORDER = 512,
NOREDRAW = 8,
NOREPOSITION = 512,
NOSENDCHANGING = 1024,
NOSIZE = 1,
NOZORDER = 4,
SHOWWINDOW = 64,
}
public bool IsAcrylicEnabled
{
get => (bool)GetValue(IsAcrylicEnabledProperty);
set => SetValue(IsAcrylicEnabledProperty, value);
}
public static readonly DependencyProperty IsAcrylicEnabledProperty = DependencyProperty.Register(
nameof(IsAcrylicEnabled),
typeof(bool),
typeof(AcrylicWindow),
new PropertyMetadata(true, OnAcrylicPropertyChanged)
);
public Color AcrylicGradientColor
{
get => (Color)GetValue(AcrylicGradientColorProperty);
set => SetValue(AcrylicGradientColorProperty, value);
}
public static readonly DependencyProperty AcrylicGradientColorProperty = DependencyProperty.Register(
nameof(AcrylicGradientColor),
typeof(Color),
typeof(AcrylicWindow),
new PropertyMetadata(Colors.Transparent, OnAcrylicPropertyChanged)
);
public bool ShowAccentBorder
{
get => (bool)GetValue(ShowAccentBorderProperty);
set => SetValue(ShowAccentBorderProperty, value);
}
public static readonly DependencyProperty ShowAccentBorderProperty = DependencyProperty.Register(
nameof(ShowAccentBorder),
typeof(bool),
typeof(AcrylicWindow),
new PropertyMetadata(false, OnAcrylicPropertyChanged)
);
protected AcrylicWindow()
{
// Use layered window when Windows transparency is disabled to prevent white flash on open
if (!Utils.IsWindowsTransparencyEnabled())
{
WindowStyle = WindowStyle.None;
AllowsTransparency = true;
}
WindowChrome.SetWindowChrome(
this,
new WindowChrome
{
GlassFrameThickness = new Thickness(0),
CaptionHeight = 0,
ResizeBorderThickness = new Thickness(5),
CornerRadius = new CornerRadius(0),
}
);
Background = Brushes.Transparent;
Loaded += OnWindowLoaded;
SourceInitialized += OnSourceInitialized;
ThemeAwareness.ResourceChanged += OnThemeChanged;
}
private void OnThemeChanged(object? sender, ResourcesChangedEventArgs e)
{
if (!Utils.IsWindowsTransparencyEnabled())
UpdateBackgroundColor();
}
private void UpdateBackgroundColor()
{
var hwndSource = PresentationSource.FromVisual(this) as HwndSource;
if (hwndSource?.CompositionTarget != null)
{
hwndSource.CompositionTarget.BackgroundColor = GetThemeBackgroundColor();
}
}
private void OnWindowLoaded(object sender, RoutedEventArgs e)
{
ApplyAcrylicEffect();
}
private void OnSourceInitialized(object? sender, EventArgs e)
{
ApplyAcrylicEffect();
ApplyWindowCorner();
// Reject Direct Manipulation to ensure precision touchpad scroll
// generates WM_MOUSEWHEEL instead of being consumed by the DM infrastructure.
// When WPF runs inside Explorer's process (deskband), WPF's DM conflicts with
// Explorer's own DM manager, causing touchpad scroll events to be silently lost.
if (PresentationSource.FromVisual(this) is HwndSource hwndSource)
{
hwndSource.AddHook(RejectDirectManipulation);
}
}
private static IntPtr RejectDirectManipulation(
IntPtr hwnd,
int msg,
IntPtr wParam,
IntPtr lParam,
ref bool handled
)
{
const int DM_POINTERHITTEST = 0x0250;
if (msg == DM_POINTERHITTEST)
{
handled = true;
return IntPtr.Zero;
}
return IntPtr.Zero;
}
private static Color GetThemeBackgroundColor()
{
var isLightTheme = Utils.IsLightTheme();
var isWindows11 = Utils.GetWindowsVersion() >= Utils.WindowsVersion.Windows11;
if (isWindows11)
return isLightTheme ? Color.FromRgb(0xf0, 0xf0, 0xf0) : Color.FromRgb(0x25, 0x25, 0x25);
else
return isLightTheme ? Color.FromRgb(0xee, 0xee, 0xee) : Color.FromRgb(0x22, 0x22, 0x22);
}
private static void OnAcrylicPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is AcrylicWindow { IsLoaded: true } window)
{
window.ApplyAcrylicEffect();
}
}
private void ApplyAcrylicEffect()
{
if (!IsAcrylicEnabled)
return;
var hwndSource = PresentationSource.FromVisual(this) as HwndSource;
if (hwndSource?.Handle == IntPtr.Zero)
return;
var handle = hwndSource!.Handle;
var accentPolicy = new AccentPolicy
{
AccentState = AccentState.EnableAcrylicBlurBehind,
AccentFlags = ShowAccentBorder ? AccentFlags.AllBorder : AccentFlags.None,
GradientColor = CreateColorInteger(AcrylicGradientColor),
AnimationId = 0,
};
var accentPolicyPtr = Marshal.AllocHGlobal(Marshal.SizeOf());
try
{
Marshal.StructureToPtr(accentPolicy, accentPolicyPtr, false);
var windowCompositionAttributeData = new WindowCompositionAttributeData
{
Attribute = WindowCompositionAttribute.WcaAccentPolicy,
DataPointer = accentPolicyPtr,
DataSize = (uint)Marshal.SizeOf(),
};
hwndSource.CompositionTarget!.BackgroundColor = Utils.IsWindowsTransparencyEnabled()
? Colors.Transparent
: GetThemeBackgroundColor();
var margins = new Margins
{
LeftWidth = 0,
RightWidth = 0,
TopHeight = 0,
BottomHeight = 0,
};
DwmExtendFrameIntoClientArea(handle, ref margins);
SetWindowCompositionAttribute(handle, ref windowCompositionAttributeData);
SetWindowPos(
handle,
IntPtr.Zero,
0,
0,
0,
0,
SetWindowPosFlags.DRAWFRAME
| SetWindowPosFlags.NOACTIVATE
| SetWindowPosFlags.NOMOVE
| SetWindowPosFlags.NOOWNERZORDER
| SetWindowPosFlags.NOSIZE
| SetWindowPosFlags.NOZORDER
);
}
finally
{
Marshal.FreeHGlobal(accentPolicyPtr);
}
}
private void ApplyWindowCorner()
{
var hwndSource = PresentationSource.FromVisual(this) as HwndSource;
if (hwndSource?.Handle == IntPtr.Zero)
return;
var handle = hwndSource!.Handle;
// Determine corner style based on Windows version
var windowsVersion = Utils.GetWindowsVersion();
var cornerStyle =
windowsVersion >= Utils.WindowsVersion.Windows11 ? WindowCorner.Round : WindowCorner.RoundSmall;
var corner = (int)cornerStyle;
DwmSetWindowAttribute(handle, DwmWindowAttribute.WINDOW_CORNER_PREFERENCE, ref corner, sizeof(int));
}
private static int CreateColorInteger(Color color)
{
return color.R << 0 | color.G << 8 | color.B << 16 | color.A << 24;
}
}
}
================================================
FILE: EverythingToolbar/Controls/FilterSelector.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/FilterSelector.xaml.cs
================================================
using System.Windows;
using System.Windows.Controls;
using EverythingToolbar.Data;
using EverythingToolbar.Helpers;
namespace EverythingToolbar.Controls
{
public partial class FilterSelector
{
public static readonly DependencyProperty SelectedFilterProperty = DependencyProperty.Register(
nameof(SelectedFilter),
typeof(Filter),
typeof(FilterSelector),
new FrameworkPropertyMetadata(
null,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
OnSelectedFilterChanged
)
);
private static void OnSelectedFilterChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (FilterSelector)d;
control.UpdateSelectedItems();
}
public Filter? SelectedFilter
{
get => (Filter)GetValue(SelectedFilterProperty);
set => SetValue(SelectedFilterProperty, value);
}
public FilterSelector()
{
InitializeComponent();
Loaded += (_, _) => UpdateSelectedItems();
}
private void UpdateSelectedItems()
{
if (SelectedFilter == null)
return;
TabControl.SelectionChanged -= OnTabItemSelected;
ComboBox.SelectionChanged -= OnComboBoxItemSelected;
int filterIndex = FilterLoader.Instance.Filters.IndexOf(SelectedFilter);
int maxTabItems = ToolbarSettings.User.MaxTabItems;
TabControl.SelectedIndex = filterIndex < maxTabItems ? filterIndex : -1;
ComboBox.SelectedIndex = filterIndex >= maxTabItems ? filterIndex - maxTabItems : -1;
TabControl.SelectionChanged += OnTabItemSelected;
ComboBox.SelectionChanged += OnComboBoxItemSelected;
}
private void OnTabItemSelected(object sender, SelectionChangedEventArgs e)
{
if (TabControl.SelectedIndex < 0)
return;
if (!TabControl.IsFocused && !TabControl.IsMouseOver)
{
TabControl.SelectedIndex = -1;
return;
}
if (TabControl.SelectedItem is Filter selectedFilter)
SelectedFilter = selectedFilter;
}
private void OnComboBoxItemSelected(object sender, SelectionChangedEventArgs e)
{
if (ComboBox.SelectedIndex < 0)
return;
if (!ComboBox.IsFocused && !ComboBox.IsMouseOver)
{
ComboBox.SelectedIndex = -1;
return;
}
if (ComboBox.SelectedItem is Filter selectedFilter)
SelectedFilter = selectedFilter;
}
}
}
================================================
FILE: EverythingToolbar/Controls/FluentMessageBox.cs
================================================
using System.Windows;
using System.Windows.Controls;
using Wpf.Ui.Appearance;
using Wpf.Ui.Controls;
using MessageBox = Wpf.Ui.Controls.MessageBox;
using TextBlock = System.Windows.Controls.TextBlock;
namespace EverythingToolbar.Controls
{
public static class FluentMessageBox
{
private static MessageBox CreateBase(string title)
{
var messageBox = new MessageBox()
{
Title = title,
IsCloseButtonEnabled = true,
MinWidth = 300,
};
// We need to apply resources before setting the content on the base message box
ApplicationThemeManager.Apply(
SystemThemeManager.GetCachedSystemTheme() == SystemTheme.Light
? ApplicationTheme.Light
: ApplicationTheme.Dark
);
ApplicationThemeManager.Apply(messageBox);
return messageBox;
}
private static TextBlock CreateTextBlock(string text)
{
return new TextBlock
{
Text = text,
FontSize = 14,
Margin = new Thickness(20),
TextWrapping = TextWrapping.Wrap,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Stretch,
};
}
public static MessageBox CreateRegular(string content, string title)
{
var messageBox = CreateBase(title);
messageBox.Content = CreateTextBlock(content);
return messageBox;
}
public static MessageBox CreateYesNo(string content, string title)
{
var messageBox = CreateRegular(content, title);
messageBox.PrimaryButtonText = "Yes";
messageBox.SecondaryButtonText = "No";
messageBox.IsCloseButtonEnabled = false;
return messageBox;
}
public static MessageBox CreateError(string content, string title)
{
var messageBox = CreateBase(title);
messageBox.IsPrimaryButtonEnabled = false;
var symbolIcon = new SymbolIcon
{
Symbol = SymbolRegular.Warning28,
FontSize = 32,
VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(0, 0, 20, 0),
};
Grid.SetColumn(symbolIcon, 0);
var textBlock = new TextBlock
{
Text = content,
FontSize = 14,
TextWrapping = TextWrapping.Wrap,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Stretch,
};
Grid.SetColumn(textBlock, 1);
messageBox.Content = new Grid
{
Margin = new Thickness(20, 0, 20, 0),
ColumnDefinitions =
{
new ColumnDefinition { Width = GridLength.Auto },
new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
},
Children = { symbolIcon, textBlock },
};
return messageBox;
}
}
}
================================================
FILE: EverythingToolbar/Controls/GenericBanner.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/GenericBanner.xaml.cs
================================================
using System;
using System.Windows;
using System.Windows.Media;
namespace EverythingToolbar.Controls
{
public partial class GenericBanner
{
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
nameof(Text),
typeof(string),
typeof(GenericBanner),
new PropertyMetadata(string.Empty)
);
public static readonly DependencyProperty HeadlineProperty = DependencyProperty.Register(
nameof(Headline),
typeof(string),
typeof(GenericBanner),
new PropertyMetadata(string.Empty)
);
public static readonly DependencyProperty PrimaryButtonTextProperty = DependencyProperty.Register(
nameof(PrimaryButtonText),
typeof(string),
typeof(GenericBanner),
new PropertyMetadata(string.Empty)
);
public static readonly DependencyProperty SecondaryButtonTextProperty = DependencyProperty.Register(
nameof(SecondaryButtonText),
typeof(string),
typeof(GenericBanner),
new PropertyMetadata(string.Empty)
);
public static readonly DependencyProperty BannerColorProperty = DependencyProperty.Register(
nameof(BannerColor),
typeof(Brush),
typeof(GenericBanner),
new PropertyMetadata(new SolidColorBrush(Color.FromRgb(255, 158, 51)))
);
public static readonly DependencyProperty ButtonBorderBrushProperty = DependencyProperty.Register(
nameof(ButtonBorderBrush),
typeof(Brush),
typeof(GenericBanner),
new PropertyMetadata(new SolidColorBrush(Color.FromArgb(45, 0, 0, 0)))
);
public string Text
{
get => (string)GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
public string Headline
{
get => (string)GetValue(HeadlineProperty);
set => SetValue(HeadlineProperty, value);
}
public string PrimaryButtonText
{
get => (string)GetValue(PrimaryButtonTextProperty);
set => SetValue(PrimaryButtonTextProperty, value);
}
public string SecondaryButtonText
{
get => (string)GetValue(SecondaryButtonTextProperty);
set => SetValue(SecondaryButtonTextProperty, value);
}
public Brush BannerColor
{
get => (Brush)GetValue(BannerColorProperty);
set => SetValue(BannerColorProperty, value);
}
public Brush ButtonBorderBrush
{
get => (Brush)GetValue(ButtonBorderBrushProperty);
set => SetValue(ButtonBorderBrushProperty, value);
}
public event EventHandler? PrimaryButtonClicked;
public event EventHandler? SecondaryButtonClicked;
public GenericBanner()
{
InitializeComponent();
}
private void OnPrimaryButtonClicked(object sender, RoutedEventArgs e)
{
PrimaryButtonClicked?.Invoke(this, EventArgs.Empty);
}
private void OnSecondaryButtonClicked(object sender, RoutedEventArgs e)
{
SecondaryButtonClicked?.Invoke(this, EventArgs.Empty);
}
}
}
================================================
FILE: EverythingToolbar/Controls/SearchBox.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/SearchBox.xaml.cs
================================================
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using EverythingToolbar.Helpers;
using EverythingToolbar.Search;
namespace EverythingToolbar.Controls
{
public partial class SearchBox
{
public static readonly DependencyProperty SearchTermProperty = DependencyProperty.Register(
nameof(SearchTerm),
typeof(string),
typeof(SearchBox),
new FrameworkPropertyMetadata(
string.Empty,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
OnSearchTermPropertyChanged
)
);
public string SearchTerm
{
get => (string)GetValue(SearchTermProperty);
set => SetValue(SearchTermProperty, value);
}
private static void OnSearchTermPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is SearchBox searchBox && e.NewValue is string newValue)
{
if (searchBox.TextBox.Text == newValue)
return;
searchBox.TextBox.Text = newValue;
searchBox.TextBox.CaretIndex = searchBox.TextBox.Text.Length;
}
}
private bool _isInternalTextChange;
public SearchBox()
{
InitializeComponent();
InputMethod.SetPreferredImeState(this, InputMethodState.DoNotCare);
ToolbarSettings.User.PropertyChanged += OnSettingsChanged;
EventDispatcher.Instance.SearchBoxFocusRequested += OnFocusRequested;
}
private void OnTextChanged(object sender, TextChangedEventArgs e)
{
if (_isInternalTextChange)
return;
if (ToolbarSettings.User.IsSearchAsYouType)
{
SearchTerm = TextBox.Text;
}
}
private void OnFocusRequested(object? sender, EventArgs e)
{
// Only visible SearchBoxes should respond to focus requests
if (Visibility == Visibility.Visible)
Focus();
}
private void OnPreviewKeyDown(object? sender, KeyEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Up)
{
UpdateSearchTerm(HistoryManager.Instance.GetPreviousItem());
e.Handled = true;
}
else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Down)
{
UpdateSearchTerm(HistoryManager.Instance.GetNextItem());
e.Handled = true;
}
else if (
Keyboard.Modifiers == ModifierKeys.None
&& e.Key == Key.Enter
&& !ToolbarSettings.User.IsSearchAsYouType
)
{
SearchTerm = TextBox.Text;
e.Handled = true;
}
else if (
e.Key is Key.Home or Key.End
&& Keyboard.Modifiers != ModifierKeys.Shift
&& ToolbarSettings.User.IsHomeEndNavigateResults
|| e.Key == Key.PageDown
|| e.Key == Key.PageUp
|| e.Key == Key.Up
|| e.Key == Key.Down
|| e.Key == Key.Escape
|| e.Key == Key.Enter
|| e.SystemKey == Key.Enter // When Alt is held
|| (
e.Key is >= Key.D0 and <= Key.D9 or Key.I or Key.B or Key.U or Key.R
&& Keyboard.Modifiers == ModifierKeys.Control
)
)
{
EventDispatcher.Instance.InvokeGlobalKeyEvent(this, e);
e.Handled = true;
}
else if (e.Key == Key.Tab)
{
// The down stroke of the Tab key is not always consistent. Therefore it's handled by the up stroke event.
e.Handled = true;
}
}
private void OnPreviewKeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Tab)
{
var offset = Keyboard.Modifiers.HasFlag(ModifierKeys.Shift) ? -1 : 1;
SearchState.Instance.CycleFilters(offset);
e.Handled = true;
}
}
private void UpdateSearchTerm(string newSearchTerm)
{
_isInternalTextChange = true;
TextBox.Text = newSearchTerm;
TextBox.CaretIndex = TextBox.Text.Length;
SearchTerm = newSearchTerm;
_isInternalTextChange = false;
}
private void OnSettingsChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(ToolbarSettings.User.IsShowQuickToggles))
UpdateQuickTogglesVisibility();
}
private void OnSizeChanged(object? sender, SizeChangedEventArgs e)
{
UpdateQuickTogglesVisibility();
}
private void UpdateQuickTogglesVisibility()
{
if (ToolbarSettings.User.IsShowQuickToggles && ActualWidth > 200)
{
QuickToggleButtons.Visibility = Visibility.Visible;
TextBox.Padding = new Thickness(37, 0, 130, 0);
}
else
{
QuickToggleButtons.Visibility = Visibility.Collapsed;
TextBox.Padding = new Thickness(37, 0, 10, 0);
}
}
public new void Focus()
{
if (PresentationSource.FromVisual(TextBox) is HwndSource hwnd)
{
NativeMethods.ForciblySetForegroundWindow(hwnd.Handle);
}
TextBox.Focus();
Keyboard.Focus(TextBox);
}
private void OnGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
TextBox.SelectAll();
EventDispatcher.Instance.InvokeSearchBoxFocusedNotification(this, EventArgs.Empty);
}
private void OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (e.NewFocus == null) // New focus outside application
{
SearchWindow.Instance.Hide();
}
}
private void SelectivelyIgnoreMouseButton(object sender, MouseButtonEventArgs e)
{
if (sender is TextBox { IsKeyboardFocusWithin: false } textBox)
{
e.Handled = true;
textBox.Focus();
}
}
private void OnPasteClicked(object sender, RoutedEventArgs args)
{
TextBox.Paste();
}
private void OnCopyClicked(object sender, RoutedEventArgs args)
{
TextBox.Copy();
}
private void OnCutClicked(object sender, RoutedEventArgs args)
{
TextBox.Cut();
}
}
}
================================================
FILE: EverythingToolbar/Controls/SearchButton.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/SearchButton.xaml.cs
================================================
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using EverythingToolbar.Behaviors;
using EverythingToolbar.Helpers;
namespace EverythingToolbar.Controls
{
public partial class SearchButton
{
public SearchButton()
{
InitializeComponent();
SearchWindow.Instance.Activated += OnSearchWindowActivated;
SearchWindow.Instance.Deactivated += OnSearchWindowDeactivated;
ThemeAwareness.ResourceChanged += UpdateTheme;
}
private void OnSearchWindowDeactivated(object? sender, EventArgs e)
{
if (Template.FindName("OuterBorder", this) is not Border border)
return;
border.Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
}
private void OnSearchWindowActivated(object? sender, EventArgs e)
{
if (Template.FindName("OuterBorder", this) is not Border border)
return;
border.Background = new SolidColorBrush(Color.FromArgb(64, 255, 255, 255));
}
private void UpdateTheme(Theme newTheme)
{
if (Template.FindName("OuterBorder", this) is not Border border)
return;
if (newTheme == Theme.Light)
{
Foreground = new SolidColorBrush(Colors.Black);
border.Opacity = 0.55;
}
else
{
Foreground = new SolidColorBrush(Colors.White);
border.Opacity = 0.2;
}
}
private void UpdateTheme(object? sender, ResourcesChangedEventArgs e)
{
if (IsLoaded)
UpdateTheme(e.NewTheme);
else
Loaded += (_, _) =>
{
UpdateTheme(e.NewTheme);
};
}
private void OnClick(object? sender, RoutedEventArgs e)
{
SearchWindow.Instance.Toggle();
}
private void OnIsVisibleChanged(object? sender, DependencyPropertyChangedEventArgs e)
{
TaskbarStateManager.Instance.IsIcon = (bool)e.NewValue;
}
}
}
================================================
FILE: EverythingToolbar/Controls/SearchResultPreviewPane.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/SearchResultPreviewPane.xaml.cs
================================================
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using EverythingToolbar.Data;
using EverythingToolbar.Settings;
namespace EverythingToolbar.Controls
{
public partial class SearchResultPreviewPane
{
public sealed class PreviewActionItem
{
public string Label { get; init; } = "";
public string Glyph { get; init; } = "";
public Action Action { get; init; } = _ => { };
}
public static readonly DependencyProperty SelectedResultProperty = DependencyProperty.Register(
nameof(SelectedResult),
typeof(SearchResult),
typeof(SearchResultPreviewPane),
new PropertyMetadata(null, OnSelectedResultChanged)
);
public static readonly DependencyProperty HasSelectionProperty = DependencyProperty.Register(
nameof(HasSelection),
typeof(bool),
typeof(SearchResultPreviewPane),
new PropertyMetadata(false)
);
public static readonly DependencyProperty ShowPathInfoProperty = DependencyProperty.Register(
nameof(ShowPathInfo),
typeof(bool),
typeof(SearchResultPreviewPane),
new PropertyMetadata(false)
);
public static readonly DependencyProperty ShowSizeInfoProperty = DependencyProperty.Register(
nameof(ShowSizeInfo),
typeof(bool),
typeof(SearchResultPreviewPane),
new PropertyMetadata(false)
);
public static readonly DependencyProperty HasVisibleFileInfoProperty = DependencyProperty.Register(
nameof(HasVisibleFileInfo),
typeof(bool),
typeof(SearchResultPreviewPane),
new PropertyMetadata(false)
);
public SearchResult? SelectedResult
{
get => (SearchResult?)GetValue(SelectedResultProperty);
set => SetValue(SelectedResultProperty, value);
}
public bool HasSelection
{
get => (bool)GetValue(HasSelectionProperty);
private set => SetValue(HasSelectionProperty, value);
}
public bool ShowPathInfo
{
get => (bool)GetValue(ShowPathInfoProperty);
private set => SetValue(ShowPathInfoProperty, value);
}
public bool ShowSizeInfo
{
get => (bool)GetValue(ShowSizeInfoProperty);
private set => SetValue(ShowSizeInfoProperty, value);
}
public bool HasVisibleFileInfo
{
get => (bool)GetValue(HasVisibleFileInfoProperty);
private set => SetValue(HasVisibleFileInfoProperty, value);
}
public ObservableCollection PreviewActions { get; } = [];
public SearchResultPreviewPane()
{
InitializeComponent();
ToolbarSettings.User.PropertyChanged += OnToolbarSettingsPropertyChanged;
Unloaded += OnUnloaded;
}
private static void OnSelectedResultChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is SearchResultPreviewPane pane)
pane.RefreshActions();
}
private void OnUnloaded(object sender, RoutedEventArgs e)
{
ToolbarSettings.User.PropertyChanged -= OnToolbarSettingsPropertyChanged;
Unloaded -= OnUnloaded;
}
private void OnToolbarSettingsPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(ToolbarSettingsWrapper.ItemTemplate))
RefreshActions();
}
private void RefreshActions()
{
HasSelection = SelectedResult != null;
PreviewActions.Clear();
if (SelectedResult == null)
{
ShowPathInfo = false;
ShowSizeInfo = false;
HasVisibleFileInfo = false;
return;
}
UpdateFileInfoVisibility();
AddAction(
Properties.Resources.ContextMenuOpen,
"\uE8A5",
result =>
{
if (!CustomActions.HandleAction(result))
result.Open();
}
);
AddAction(Properties.Resources.ContextMenuOpenPath, "\uE838", result => result.OpenPath());
AddAction(Properties.Resources.ContextMenuOpenWith, "\uE7AC", result => result.OpenWith());
AddAction(Properties.Resources.ContextMenuShowInEverything, "\uF78B", result => result.ShowInEverything());
AddAction(Properties.Resources.ContextMenuProperties, "\uE946", result => result.ShowProperties());
}
private void UpdateFileInfoVisibility()
{
var template = ToolbarSettings.User.ItemTemplate ?? "";
bool isDetailed =
template.Equals("NormalDetailed", StringComparison.OrdinalIgnoreCase)
|| template.Equals("CompactDetailed", StringComparison.OrdinalIgnoreCase);
ShowPathInfo = !isDetailed;
ShowSizeInfo = !isDetailed && SelectedResult?.IsFile == true;
HasVisibleFileInfo = ShowPathInfo || ShowSizeInfo;
}
private void AddAction(string label, string glyph, Action action)
{
PreviewActions.Add(
new PreviewActionItem
{
Label = label,
Glyph = glyph,
Action = action,
}
);
}
private void OnActionButtonClick(object sender, RoutedEventArgs e)
{
if (SelectedResult == null || sender is not Button { DataContext: PreviewActionItem item })
return;
item.Action(SelectedResult);
SearchWindow.Instance.Hide();
}
}
}
================================================
FILE: EverythingToolbar/Controls/SearchResultsView.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/SearchResultsView.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using EverythingToolbar.Data;
using EverythingToolbar.Helpers;
using EverythingToolbar.Search;
using EverythingToolbar.Settings;
using SearchResult = EverythingToolbar.Data.SearchResult;
namespace EverythingToolbar.Controls
{
public partial class SearchResultsView
{
public static readonly DependencyProperty SelectedSearchResultProperty = DependencyProperty.Register(
nameof(SelectedSearchResult),
typeof(SearchResult),
typeof(SearchResultsView),
new PropertyMetadata(null)
);
public static readonly DependencyProperty TotalResultsCountProperty = DependencyProperty.Register(
nameof(TotalResultsCount),
typeof(int),
typeof(SearchResultsView),
new PropertyMetadata(0)
);
public int TotalResultsCount
{
get => (int)GetValue(TotalResultsCountProperty);
set => SetValue(TotalResultsCountProperty, value);
}
public SearchResult? SelectedSearchResult
{
get => (SearchResult?)GetValue(SelectedSearchResultProperty);
set => SetValue(SelectedSearchResultProperty, value);
}
private SearchResult? SelectedItem => SelectedSearchResult;
private const int PageSize = 256;
private Point _dragStart;
private bool _isScrollBarDragging;
private int? _touchId;
private VirtualizingCollection? _searchResultsCollection;
private SynchronizationContext _synchronizationContext = new();
private readonly DispatcherTimer _busyIndicatorTimer;
private const int BusyIndicatorDelayMilliseconds = 2000;
public SearchResultsView()
{
InitializeComponent();
SearchState.Instance.PropertyChanged += (_, _) => UpdateSearchResultsProvider(SearchState.Instance);
EventDispatcher.Instance.GlobalKeyEvent += OnKeyPressed;
SearchResultsListView.PreviewKeyDown += OnKeyPressed;
SearchResultsListView.PreviewMouseLeftButtonDown += OnPreviewLeftMouseButtonDown;
_busyIndicatorTimer = new DispatcherTimer
{
Interval = TimeSpan.FromMilliseconds(BusyIndicatorDelayMilliseconds),
};
_busyIndicatorTimer.Tick += BusyIndicatorTimerElapsed;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
_synchronizationContext = SynchronizationContext.Current ?? new SynchronizationContext();
UpdateSearchResultsProvider(SearchState.Instance);
AutoSelectFirstResult();
AttachToScrollViewer();
}
private void UpdateSearchResultsProvider(SearchState searchState)
{
if (ToolbarSettings.User.IsHideEmptySearchResults && string.IsNullOrEmpty(searchState.SearchTerm))
{
_searchResultsCollection = null;
SearchResultsListView.ItemsSource = null;
TotalResultsCount = 0;
return;
}
SearchResultProvider newProvider = new(searchState, _synchronizationContext);
if (_searchResultsCollection == null)
{
_searchResultsCollection = new VirtualizingCollection(
newProvider,
PageSize,
_synchronizationContext
);
_searchResultsCollection.CollectionChanged += (_, args) =>
{
if (args.Action == NotifyCollectionChangedAction.Reset)
{
TotalResultsCount = _searchResultsCollection.Count;
Dispatcher.BeginInvoke(AutoSelectFirstResult);
}
};
_searchResultsCollection.PropertyChanged += (_, args) =>
{
if (args.PropertyName == nameof(VirtualizingCollection.IsBusy))
{
OnCollectionIsBusyChanged();
}
};
}
else
{
_searchResultsCollection?.UpdateProvider(newProvider);
}
SearchResultsListView.ItemsSource = _searchResultsCollection;
}
private void OnCollectionIsBusyChanged()
{
if (_searchResultsCollection is { IsBusy: true })
{
if (!_busyIndicatorTimer.IsEnabled)
{
_busyIndicatorTimer.Start();
}
}
else
{
_busyIndicatorTimer.Stop();
SpinnerOverlay.Visibility = Visibility.Collapsed;
SearchResultsListView.Opacity = 1.0;
}
}
private void BusyIndicatorTimerElapsed(object? sender, EventArgs e)
{
_busyIndicatorTimer.Stop();
if (_searchResultsCollection is not { IsBusy: true })
return;
SpinnerOverlay.Visibility = Visibility.Visible;
SearchResultsListView.Opacity = 0.3;
}
private void AttachToScrollViewer()
{
var listViewBorder = VisualTreeHelper.GetChild(SearchResultsListView, 0) as Decorator;
var scrollViewer = listViewBorder?.Child as ScrollViewer;
if (scrollViewer == null)
return;
var verticalScrollBar = FindVisualChild(
scrollViewer,
s => s.Orientation == Orientation.Vertical
);
if (verticalScrollBar == null)
return;
verticalScrollBar.PreviewMouseLeftButtonDown += ScrollBar_PreviewMouseLeftButtonDown;
verticalScrollBar.PreviewMouseLeftButtonUp += ScrollBar_PreviewMouseLeftButtonUp;
verticalScrollBar.MouseLeave += ScrollBar_MouseLeave;
}
private void ScrollBar_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (_searchResultsCollection != null)
{
_isScrollBarDragging = true;
_searchResultsCollection.IsAsync = false;
}
}
private void ScrollBar_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
ResetScrollBarDragging();
}
private void ScrollBar_MouseLeave(object sender, MouseEventArgs e)
{
ResetScrollBarDragging();
}
private void ResetScrollBarDragging()
{
if (_isScrollBarDragging && _searchResultsCollection != null)
{
_isScrollBarDragging = false;
_searchResultsCollection.IsAsync = true;
}
}
private static T? FindVisualChild(DependencyObject parent, Func? condition = null)
where T : DependencyObject
{
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = VisualTreeHelper.GetChild(parent, i);
if (child is T typedChild && (condition == null || condition(typedChild)))
return typedChild;
var result = FindVisualChild(child, condition);
if (result != null)
return result;
}
return null;
}
private void OnPreviewLeftMouseButtonDown(object sender, MouseButtonEventArgs e)
{
// Prevents deselecting an item when Ctrl is held down and clicking on an already selected item
if (Keyboard.Modifiers == ModifierKeys.Control)
{
if (e.OriginalSource is not DependencyObject source)
return;
ListViewItem? item = ItemsControl.ContainerFromElement(SearchResultsListView, source) as ListViewItem;
if (item?.IsSelected == true)
e.Handled = true;
}
}
private void OnKeyPressed(object? sender, KeyEventArgs e)
{
if (e.Key == Key.Space)
{
PreviewSelectedFile();
}
else if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && e.Key == Key.Enter)
{
RunAsAdmin(this, new RoutedEventArgs());
SearchResultsListView.SelectedIndex = -1;
}
else if (Keyboard.Modifiers == ModifierKeys.Shift && e.Key == Key.Enter)
{
if (SelectedItem == null)
return;
SearchResultProvider.OpenSearchInEverything(SearchState.Instance, SelectedItem.FullPathAndFileName);
SearchResultsListView.SelectedIndex = -1;
}
else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Enter)
{
OpenFilePath(this, new RoutedEventArgs());
SearchResultsListView.SelectedIndex = -1;
}
else if (Keyboard.Modifiers == ModifierKeys.Alt && (e.Key == Key.Enter || e.SystemKey == Key.Enter))
{
ShowFileProperties(this, new RoutedEventArgs());
SearchResultsListView.SelectedIndex = -1;
}
else if (e.Key == Key.Enter)
{
if (SearchResultsListView.SelectedIndex >= 0)
{
OpenSelectedSearchResult();
SearchResultsListView.SelectedIndex = -1;
}
else
{
SelectNextSearchResult();
}
}
else if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && e.Key == Key.C)
{
SelectedItem?.CopyPathToClipboard();
}
else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.C)
{
SelectedItem?.CopyToClipboard();
}
else if (e.Key == Key.Up)
{
HandleUpNavigation();
e.Handled = true;
}
else if (e.Key == Key.Down)
{
HandleDownNavigation();
e.Handled = true;
}
else if (e.Key == Key.PageUp || e.Key == Key.PageDown || e.Key == Key.Home || e.Key == Key.End)
{
var restoreFocus = e.Key is Key.Home or Key.End && KeepSearchBoxFocused;
e.Handled = ForwardKeyPressToControl(SearchResultsListView, e.Key, restoreFocus: restoreFocus);
}
else if (e.Key == Key.I && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsMatchCase = !ToolbarSettings.User.IsMatchCase;
}
else if (e.Key == Key.B && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsMatchWholeWord = !ToolbarSettings.User.IsMatchWholeWord;
}
else if (e.Key == Key.U && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsMatchPath = !ToolbarSettings.User.IsMatchPath;
}
else if (e.Key == Key.R && Keyboard.Modifiers == ModifierKeys.Control)
{
ToolbarSettings.User.IsRegExEnabled = !ToolbarSettings.User.IsRegExEnabled;
}
}
private static bool KeepSearchBoxFocused =>
ToolbarSettings.User.IsAutoSelectFirstResult && ToolbarSettings.User.IsSearchAsYouType;
private static FocusBehavior EffectiveListFocusBehavior =>
KeepSearchBoxFocused && ToolbarSettings.User.ListFocusBehavior == FocusBehavior.RepeatWithSearch
? FocusBehavior.Repeat
: ToolbarSettings.User.ListFocusBehavior;
private void AutoSelectFirstResult()
{
if (ToolbarSettings.User.IsAutoSelectFirstResult)
SelectNthSearchResult(0);
else
SearchResultsListView.SelectedIndex = -1;
}
private void SelectNextSearchResult()
{
SelectNthSearchResult(SearchResultsListView.SelectedIndex + 1);
}
private void SelectPreviousSearchResult()
{
SelectNthSearchResult(SearchResultsListView.SelectedIndex - 1);
}
private void SelectNthSearchResult(int n)
{
if (n < 0 || n >= SearchResultsListView.Items.Count)
return;
SearchResultsListView.SelectedIndex = n;
if (SelectedItem != null)
SearchResultsListView.ScrollIntoView(SelectedItem);
if (!KeepSearchBoxFocused)
FocusSelectedItem();
}
private void JumpToEnd()
{
// Capture focus before calling Focus() on the ListView so we can restore it afterwards.
var originalFocus = Keyboard.FocusedElement;
SearchResultsListView.Focus();
ForwardKeyPressToControl(SearchResultsListView, Key.End, originalFocus, restoreFocus: KeepSearchBoxFocused);
}
private void FocusSearchBox()
{
SearchResultsListView.SelectedIndex = -1;
EventDispatcher.Instance.InvokeSearchBoxFocused(this, EventArgs.Empty);
}
private void HandleUpNavigation()
{
if (SearchResultsListView.SelectedIndex > 0)
{
SelectPreviousSearchResult();
}
else if (SearchResultsListView.SelectedIndex == 0)
{
switch (EffectiveListFocusBehavior)
{
case FocusBehavior.Repeat:
JumpToEnd();
break;
case FocusBehavior.RepeatWithSearch:
FocusSearchBox();
break;
case FocusBehavior.Clamp:
default:
if (!ToolbarSettings.User.IsAutoSelectFirstResult)
FocusSearchBox();
break;
}
}
else
{
if (EffectiveListFocusBehavior != FocusBehavior.Clamp)
JumpToEnd();
}
}
private void HandleDownNavigation()
{
if (SearchResultsListView.SelectedIndex == SearchResultsListView.Items.Count - 1)
{
switch (EffectiveListFocusBehavior)
{
case FocusBehavior.Repeat:
SelectNthSearchResult(0);
break;
case FocusBehavior.RepeatWithSearch:
FocusSearchBox();
break;
case FocusBehavior.Clamp:
default:
break;
}
}
else
{
SelectNextSearchResult();
}
}
private bool ForwardKeyPressToControl(
Control control,
Key key,
IInputElement? originalFocus = null,
bool restoreFocus = false
)
{
var presentationSource = PresentationSource.FromVisual(control);
if (presentationSource == null)
return false;
// Capture focus state before raising the event
originalFocus ??= Keyboard.FocusedElement;
var caretIndex = originalFocus is TextBox textBox ? textBox.CaretIndex : -1;
var args = new KeyEventArgs(Keyboard.PrimaryDevice, presentationSource, 0, key)
{
RoutedEvent = Keyboard.KeyDownEvent,
};
control.RaiseEvent(args);
// Restore focus to SearchBox if requested and it was previously focused
if (restoreFocus && originalFocus is TextBox restoredTextBox && caretIndex >= 0)
{
Dispatcher.BeginInvoke(
(Action)(
() =>
{
originalFocus.Focus();
restoredTextBox.CaretIndex = Math.Min(caretIndex, restoredTextBox.Text.Length);
}
),
DispatcherPriority.Send
);
}
return args.Handled;
}
private void OpenSelectedSearchResult()
{
if (SelectedItem == null)
return;
if (!CustomActions.HandleAction(SelectedItem))
SelectedItem?.Open();
SearchWindow.Instance.Hide();
}
private void OpenFilePath(object sender, RoutedEventArgs e)
{
SelectedItem?.OpenPath();
SearchWindow.Instance.Hide();
}
private void PreviewSelectedFile()
{
SelectedItem?.PreviewInQuickLook();
SelectedItem?.PreviewInSeer();
}
private void CopyPathToClipBoard(object sender, RoutedEventArgs e)
{
SelectedItem?.CopyPathToClipboard();
}
private void OpenWith(object sender, RoutedEventArgs e)
{
SelectedItem?.OpenWith();
SearchWindow.Instance.Hide();
}
private void ShowInEverything(object sender, RoutedEventArgs e)
{
SelectedItem?.ShowInEverything();
SearchWindow.Instance.Hide();
}
private void CopyFile(object sender, RoutedEventArgs e)
{
SelectedItem?.CopyToClipboard();
}
private void SingleClickSearchResult(object sender, MouseEventArgs e)
{
if (!ToolbarSettings.User.IsDoubleClickToOpen)
OpenWithMouseClick();
}
private void DoubleClickSearchResult(object sender, MouseEventArgs e)
{
if (ToolbarSettings.User.IsDoubleClickToOpen)
OpenWithMouseClick();
}
private void Open(object sender, RoutedEventArgs e)
{
OpenSelectedSearchResult();
}
private void OpenWithMouseClick()
{
switch (Keyboard.Modifiers)
{
case ModifierKeys.Alt:
SelectedItem?.ShowProperties();
SearchWindow.Instance.Hide();
break;
case ModifierKeys.Control:
SelectedItem?.OpenPath();
SearchWindow.Instance.Hide();
break;
case ModifierKeys.Shift:
SelectedItem?.ShowInEverything();
SearchWindow.Instance.Hide();
break;
default:
OpenSelectedSearchResult();
break;
}
SearchResultsListView.SelectedIndex = -1;
}
private void RunAsAdmin(object sender, RoutedEventArgs e)
{
SelectedItem?.RunAsAdmin();
SearchWindow.Instance.Hide();
}
private void ShowFileProperties(object sender, RoutedEventArgs e)
{
SelectedItem?.ShowProperties();
SearchWindow.Instance.Hide();
}
private void ShowFileWindowsContextMenu(object sender, RoutedEventArgs e)
{
SelectedItem?.ShowWindowsContextMenu();
}
private void OnOpenWithMenuLoaded(object sender, RoutedEventArgs e)
{
if (sender is not MenuItem menuItem)
return;
while (menuItem.Items.Count > 2)
menuItem.Items.RemoveAt(0);
List actions = CustomActions.LoadCustomActions();
if (actions.Count == 0)
{
menuItem.Items.Insert(
0,
new MenuItem { Header = Properties.Resources.ContextMenuOpenWithNoCustomActions, IsEnabled = false }
);
return;
}
for (int i = 0; i < actions.Count; i++)
{
Rule action = actions[i];
MenuItem actionMenuItem = new()
{
Header = action.Name,
Tag = action.Command,
DataContext = action,
};
if (action.Icon != null)
{
Image iconImage = new() { Width = 16, Height = 16 };
iconImage.SetBinding(Image.SourceProperty, new Binding("Icon"));
actionMenuItem.Icon = iconImage;
}
actionMenuItem.Click += OpenWithCustomAction;
menuItem.Items.Insert(i, actionMenuItem);
}
}
private void OpenWithCustomAction(object sender, RoutedEventArgs e)
{
if (SelectedItem == null)
return;
var menuItem = sender as MenuItem;
var command = menuItem?.Tag?.ToString() ?? "";
CustomActions.HandleAction(SelectedItem, command);
}
private void OnListViewItemMouseDown(object sender, MouseButtonEventArgs e)
{
_dragStart = PointToScreen(Mouse.GetPosition(this));
}
private void OnListViewItemMouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton != MouseButtonState.Pressed)
return;
TryStartDragDrop(PointToScreen(Mouse.GetPosition(this)));
}
private void OnListViewItemTouchDown(object sender, TouchEventArgs e)
{
_touchId = e.TouchDevice.Id;
_dragStart = PointToScreen(e.GetTouchPoint(this).Position);
}
private void OnListViewItemTouchMove(object sender, TouchEventArgs e)
{
if (_touchId != e.TouchDevice.Id)
return;
if (TryStartDragDrop(PointToScreen(e.GetTouchPoint(this).Position)))
_touchId = null;
}
private void OnListViewItemTouchUp(object sender, TouchEventArgs e)
{
if (_touchId == e.TouchDevice.Id)
_touchId = null;
}
private bool TryStartDragDrop(Point currentPosition)
{
if (SelectedItem == null)
return false;
var diff = _dragStart - currentPosition;
if (
Math.Abs(diff.X) <= SystemParameters.MinimumHorizontalDragDistance
&& Math.Abs(diff.Y) <= SystemParameters.MinimumVerticalDragDistance
)
return false;
string[] files = [SelectedItem.FullPathAndFileName];
var data = new DataObject(DataFormats.FileDrop, files);
data.SetData(DataFormats.Text, files[0]);
DragDrop.DoDragDrop(SearchResultsListView, data, DragDropEffects.All);
return true;
}
private void OnContextMenuOpening(object sender, ContextMenuEventArgs e)
{
if (SelectedItem == null)
return;
if (Keyboard.Modifiers == ModifierKeys.Shift)
{
SelectedItem.ShowWindowsContextMenu();
e.Handled = true;
}
}
private void OnContextMenuOpened(object sender, RoutedEventArgs e)
{
if (SelectedItem == null)
return;
var cm = sender as ContextMenu;
var mi = cm?.Items[2] as MenuItem;
if (mi == null)
return;
string[] extensions = [".exe", ".bat", ".cmd"];
var isExecutable =
SelectedItem.IsFile && extensions.Any(ext => SelectedItem.FullPathAndFileName.EndsWith(ext));
mi.Visibility = isExecutable ? Visibility.Visible : Visibility.Collapsed;
}
private void FocusSelectedItem()
{
var selectedItem = (ListViewItem)
SearchResultsListView.ItemContainerGenerator.ContainerFromItem(SelectedItem);
if (selectedItem != null)
Keyboard.Focus(selectedItem);
}
}
}
================================================
FILE: EverythingToolbar/Controls/SettingItem.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/SettingItem.xaml.cs
================================================
using System.Windows;
namespace EverythingToolbar.Controls
{
public partial class SettingItem
{
public SettingItem()
{
InitializeComponent();
}
public static readonly DependencyProperty SettingContentProperty = DependencyProperty.Register(
nameof(SettingContent),
typeof(object),
typeof(SettingItem),
new PropertyMetadata(null)
);
public object SettingContent
{
get => GetValue(SettingContentProperty);
set => SetValue(SettingContentProperty, value);
}
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
nameof(Title),
typeof(string),
typeof(SettingItem),
new PropertyMetadata(string.Empty)
);
public string Title
{
get => (string)GetValue(TitleProperty);
set => SetValue(TitleProperty, value);
}
public static readonly DependencyProperty HelpTextProperty = DependencyProperty.Register(
nameof(HelpText),
typeof(string),
typeof(SettingItem),
new PropertyMetadata(string.Empty)
);
public string HelpText
{
get => (string)GetValue(HelpTextProperty);
set => SetValue(HelpTextProperty, value);
}
}
}
================================================
FILE: EverythingToolbar/Controls/SettingsControl.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/SettingsControl.xaml.cs
================================================
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using EverythingToolbar.Search;
using EverythingToolbar.Settings;
namespace EverythingToolbar.Controls
{
public partial class SettingsControl
{
public SettingsControl()
{
InitializeComponent();
SelectSortType();
}
private void OpenSettingsWindow(object sender, RoutedEventArgs e)
{
SearchWindow.Instance.Hide();
Window settings = new SettingsWindow();
settings.Show();
}
private void OnSortByClicked(object sender, RoutedEventArgs e)
{
if (sender is not MenuItem selectedItem)
return;
int selectedIndex = SortByMenu.Items.IndexOf(selectedItem);
int[] fastSortExceptions = [4, 8];
if (
SearchResultProvider.GetIsFastSort(selectedIndex, ToolbarSettings.User.IsSortDescending)
|| fastSortExceptions.Contains(selectedIndex)
)
{
ToolbarSettings.User.SortBy = selectedIndex;
}
else
{
FluentMessageBox
.CreateRegular(
Properties.Resources.MessageBoxFastSortUnavailable,
Properties.Resources.MessageBoxFastSortUnavailableTitle
)
.ShowDialogAsync();
}
SelectSortType();
}
private void OnSortAscendingClicked(object sender, RoutedEventArgs e)
{
ToolbarSettings.User.IsSortDescending = false;
SelectSortType();
}
private void OnSortDescendingClicked(object sender, RoutedEventArgs e)
{
ToolbarSettings.User.IsSortDescending = true;
SelectSortType();
}
private void SelectSortType()
{
foreach (var item in SortByMenu.Items)
{
if (item is MenuItem menuItem)
menuItem.IsChecked = false;
}
if (SortByMenu.Items[ToolbarSettings.User.SortBy] is MenuItem sortByMenuItem)
sortByMenuItem.IsChecked = true;
if (ToolbarSettings.User.IsSortDescending)
SortDescendingMenuItem.IsChecked = true;
else
SortAscendingMenuItem.IsChecked = true;
}
private void OpenButtonContextMenu(object sender, RoutedEventArgs e)
{
if (sender is not Button button)
return;
if (button.ContextMenu is not { } contextMenu)
return;
contextMenu.PlacementTarget = button;
contextMenu.Placement = PlacementMode.Bottom;
contextMenu.IsOpen = true;
}
private void TogglePreviewPane(object sender, RoutedEventArgs e)
{
ToolbarSettings.User.IsPreviewPaneEnabled = !ToolbarSettings.User.IsPreviewPaneEnabled;
}
}
}
================================================
FILE: EverythingToolbar/Controls/UpdateBanner.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/UpdateBanner.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Threading.Tasks;
using System.Windows;
using EverythingToolbar.Helpers;
using NLog;
namespace EverythingToolbar.Controls
{
public partial class UpdateBanner
{
private Version? _latestVersion;
private static readonly ILogger Logger = ToolbarLogger.GetLogger();
private static readonly string ApiUrl = "https://api.github.com/repos/srwi/EverythingToolbar/releases";
private static readonly string LatestReleaseUrl = "https://github.com/srwi/EverythingToolbar/releases/latest";
public UpdateBanner()
{
InitializeComponent();
}
private static async Task GetLatestStableReleaseVersion()
{
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
using var client = new HttpClient();
client.DefaultRequestHeaders.UserAgent.ParseAdd("EverythingToolbar");
var response = await client.GetAsync(ApiUrl);
if (response.IsSuccessStatusCode)
{
var jsonStream = await response.Content.ReadAsStreamAsync();
var serializer = new DataContractJsonSerializer(typeof(List));
var releases = serializer.ReadObject(jsonStream) as List;
var stableReleases = releases?.Where(r => !r.Prerelease).ToList();
var latestStableRelease = stableReleases?.FirstOrDefault();
if (latestStableRelease != null)
{
return new Version(latestStableRelease.TagName);
}
}
}
catch
{
Logger.Info("Failed to get latest release version.");
}
return null;
}
private async void OnLoaded(object sender, RoutedEventArgs e)
{
try
{
if (!ToolbarSettings.User.IsUpdateNotificationsEnabled)
return;
var latestVersion = await CheckForUpdateAsync();
if (latestVersion == null || latestVersion == TryGetSkippedUpdate())
return;
_latestVersion = latestVersion;
if (FindName("Banner") is GenericBanner banner)
{
banner.Text = $"{Properties.Resources.UpdateBannerText} {_latestVersion}";
}
Visibility = Visibility.Visible;
}
catch (Exception ex)
{
Logger.Error("Failed to check for updates: {Message}", ex.Message);
}
}
private static Version? TryGetSkippedUpdate()
{
try
{
return new Version(ToolbarSettings.User.SkippedUpdate);
}
catch
{
return null;
}
}
private void OnDownloadClicked(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo(LatestReleaseUrl) { UseShellExecute = true });
}
private void OnSkipUpdateClicked(object sender, EventArgs e)
{
if (_latestVersion != null)
{
ToolbarSettings.User.SkippedUpdate = _latestVersion.ToString();
}
Visibility = Visibility.Collapsed;
}
public static async Task CheckForUpdateAsync()
{
var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
var latestVersion = await GetLatestStableReleaseVersion();
if (latestVersion == null)
return null;
if (assemblyVersion == null || assemblyVersion.CompareTo(latestVersion) >= 0)
return null;
return latestVersion;
}
[DataContract]
private class Release
{
[DataMember(Name = "tag_name")]
public string TagName { get; set; } = string.Empty;
[DataMember(Name = "prerelease")]
public bool Prerelease { get; set; }
}
}
}
================================================
FILE: EverythingToolbar/Controls/UpdateSuccessfulBanner.xaml
================================================
================================================
FILE: EverythingToolbar/Controls/UpdateSuccessfulBanner.xaml.cs
================================================
using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows;
namespace EverythingToolbar.Controls
{
public partial class UpdateSuccessfulBanner
{
private static readonly string DonateUrl = "https://github.com/srwi/EverythingToolbar#-support";
private static readonly string CurrentVersion = GetCurrentVersion();
public UpdateSuccessfulBanner()
{
InitializeComponent();
}
private static string GetCurrentVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version is { } version
? $"{version.Major}.{version.Minor}.{version.MajorRevision}"
: "";
}
private static bool ShouldShowUpdateNotification()
{
string versionBeforeUpdate = ToolbarSettings.User.VersionBeforeUpdate;
if (string.IsNullOrEmpty(versionBeforeUpdate))
{
ToolbarSettings.User.VersionBeforeUpdate = CurrentVersion;
return false;
}
if (versionBeforeUpdate != CurrentVersion)
{
return true;
}
return false;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
Banner.Headline = Properties.Resources.UpdateSuccessfulBannerHeader.Replace("{version}", CurrentVersion);
if (ShouldShowUpdateNotification())
{
Visibility = Visibility.Visible;
}
}
private void OnDonateClicked(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo(DonateUrl) { UseShellExecute = true });
}
private void OnDismissClicked(object sender, EventArgs e)
{
ToolbarSettings.User.VersionBeforeUpdate = CurrentVersion;
Visibility = Visibility.Collapsed;
}
}
}
================================================
FILE: EverythingToolbar/Converters/BoolToVisibilityConverter.cs
================================================
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
namespace EverythingToolbar.Converters
{
public class BoolToVisibilityConverter : MarkupExtension, IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
bool invert = System.Convert.ToBoolean(parameter);
if (value == null)
return invert ? Visibility.Visible : Visibility.Collapsed;
if ((bool)value)
return invert ? Visibility.Collapsed : Visibility.Visible;
return invert ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This converter cannot be used in two-way binding.");
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}
================================================
FILE: EverythingToolbar/Converters/HighlightedTextConverter.cs
================================================
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Markup;
namespace EverythingToolbar.Converters
{
public class HighlightedTextConverter : MarkupExtension, IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is not string input)
return null;
TextBlock textBlock = new() { TextTrimming = TextTrimming.CharacterEllipsis };
if (parameter is string paramStr && double.TryParse(paramStr, out double fontSizePt))
{
// Convert points to DIPs (1pt = 4/3 DIP)
textBlock.FontSize = fontSizePt * 4.0 / 3.0;
}
string[] segments = input.Split('*');
for (int j = 0; j < segments.Length; j++)
{
if (j % 2 > 0)
{
textBlock.Inlines.Add(new Run(segments[j]) { FontWeight = FontWeights.Bold });
}
else
{
textBlock.Inlines.Add(new Run(segments[j]));
}
}
return textBlock;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This converter cannot be used in two-way binding.");
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}
================================================
FILE: EverythingToolbar/Converters/NotConverter.cs
================================================
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
namespace EverythingToolbar.Converters
{
public class NotConverter : MarkupExtension, IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
ArgumentNullException.ThrowIfNull(value);
return !(bool)value;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This converter cannot be used in two-way binding.");
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}
================================================
FILE: EverythingToolbar/Converters/NullToVisibilityConverter.cs
================================================
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
namespace EverythingToolbar.Converters
{
public class NullToVisibilityConverter : MarkupExtension, IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value == null ? Visibility.Hidden : Visibility.Visible;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This converter cannot be used in two-way binding.");
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}
================================================
FILE: EverythingToolbar/Converters/PreviewPaneToggleIconConverter.cs
================================================
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
namespace EverythingToolbar.Converters
{
public class PreviewPaneToggleIconConverter : MarkupExtension, IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return value is true ? "\uE89F" : "\uE8A0";
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This converter cannot be used in two-way binding.");
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}
================================================
FILE: EverythingToolbar/Converters/SearchResultsCountConverter.cs
================================================
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
using EverythingToolbar.Properties;
namespace EverythingToolbar.Converters
{
public class SearchResultsCountConverter : MarkupExtension, IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value == null)
return "";
var formattedValue = ((int)value).ToString("N0", culture);
var suffix = (int)value == 1 ? Resources.SearchResult : Resources.SearchResults;
return $"{formattedValue} {suffix}";
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This converter cannot be used in two-way binding.");
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}
================================================
FILE: EverythingToolbar/Converters/SkipItemsConverter.cs
================================================
using System;
using System.Collections;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using System.Windows.Markup;
namespace EverythingToolbar.Converters
{
public class SkipItemsMultiConverter : MarkupExtension, IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values is [IEnumerable enumerable, int count, ..])
return enumerable.Cast