├── source ├── Hook32_35 │ ├── Stdafx.cpp │ ├── makefile.def │ ├── Stdafx.h │ ├── hook.h │ ├── AssemblyInfo.cpp │ ├── Hook32_35.vcxproj.filters │ └── Injector.cpp ├── Hook32_40 │ ├── Stdafx.cpp │ ├── makefile.def │ ├── Stdafx.h │ ├── hook.h │ ├── AssemblyInfo.cpp │ ├── Hook32_40.vcxproj.filters │ └── Injector.cpp ├── Hook64_35 │ ├── Stdafx.cpp │ ├── makefile.def │ ├── Stdafx.h │ ├── AssemblyInfo.cpp │ ├── hook.h │ ├── Hook64_35.vcxproj.filters │ └── Injector.cpp ├── Hook64_40 │ ├── Stdafx.cpp │ ├── makefile.def │ ├── Stdafx.h │ ├── AssemblyInfo.cpp │ ├── hook.h │ ├── Hook64_40.vcxproj.filters │ └── Injector.cpp ├── Inspector │ ├── Images │ │ ├── dll.png │ │ ├── grid.png │ │ ├── menu.png │ │ ├── tree.png │ │ ├── type.png │ │ ├── xaml.png │ │ ├── border.png │ │ ├── button.png │ │ ├── canvas.png │ │ ├── clear.png │ │ ├── error.png │ │ ├── folder.png │ │ ├── group.png │ │ ├── image.png │ │ ├── listbox.png │ │ ├── search.png │ │ ├── slider.png │ │ ├── sort_az.png │ │ ├── textbox.png │ │ ├── warning.png │ │ ├── window.png │ │ ├── Inspector.ico │ │ ├── Inspector.png │ │ ├── checkbox.png │ │ ├── combobox.png │ │ ├── dockpanel.png │ │ ├── expander.png │ │ ├── listview.png │ │ ├── property.png │ │ ├── rectangle.png │ │ ├── resources.png │ │ ├── separator.png │ │ ├── textblock.png │ │ ├── datacontext.png │ │ ├── gridsplitter.png │ │ ├── information.png │ │ ├── mediaelement.png │ │ ├── passwordbox.png │ │ ├── progressbar.png │ │ ├── radiobutton.png │ │ ├── richtextbox.png │ │ ├── scrollviewer.png │ │ ├── stackpanel.png │ │ ├── tabcontrol.png │ │ ├── contentcontrol.png │ │ ├── field_private.png │ │ ├── inspectorlogo.png │ │ ├── method_private.png │ │ ├── method_public.png │ │ ├── noprocessicon.png │ │ ├── trigger_active.png │ │ ├── method_protected.png │ │ ├── trigger_inactive.png │ │ └── inspectorlogo_small.png │ ├── UserInterface │ │ ├── VisualResources │ │ │ ├── Images │ │ │ │ ├── active.png │ │ │ │ ├── inactive.png │ │ │ │ ├── resourceitem.png │ │ │ │ └── triggeritem.png │ │ │ └── Controls │ │ │ │ ├── Separator.xaml │ │ │ │ ├── ToolTip.xaml │ │ │ │ ├── XamlTextBlock.xaml │ │ │ │ ├── BrushEditor.xaml │ │ │ │ └── CheckBox.xaml │ │ ├── AutomationTreeView.xaml │ │ ├── Controls │ │ │ ├── PropertyItems │ │ │ │ ├── BrushPropertyItem.cs │ │ │ │ ├── BooleanPropertyItem.cs │ │ │ │ ├── IPropertyItem.cs │ │ │ │ ├── PropertyItemHelper.cs │ │ │ │ ├── ListPropertyItem.cs │ │ │ │ ├── MethodItem.cs │ │ │ │ ├── FieldItem.cs │ │ │ │ ├── CommandPropertyItem.cs │ │ │ │ ├── GridLengthPropertyItem.cs │ │ │ │ ├── ListItemPropertyItem.cs │ │ │ │ ├── ImagePropertyItem.cs │ │ │ │ └── EnumPropertyItem.cs │ │ │ ├── SearchTextBox.cs │ │ │ ├── UpdateTrigger.cs │ │ │ └── ItemControl.cs │ │ ├── EventsView.xaml.cs │ │ ├── UsageHintWindow.xaml.cs │ │ ├── Converters │ │ │ ├── ValueConverterBase.cs │ │ │ ├── EnumValuesConverter.cs │ │ │ ├── BoolInverterConverter.cs │ │ │ ├── LevelToIndentConverter.cs │ │ │ └── BoolToVisibilityConverter.cs │ │ ├── DataContextView.xaml.cs │ │ ├── AutomationTreeView.xaml.cs │ │ ├── App.xaml.cs │ │ ├── VisualTreeView.xaml.cs │ │ ├── AboutWindow.xaml.cs │ │ ├── App.xaml │ │ ├── XamlView.xaml │ │ ├── SelectorWindow.xaml.cs │ │ ├── XamlView.xaml.cs │ │ ├── TriggerView.xaml.cs │ │ ├── ResourcesView.xaml.cs │ │ ├── StyleExplorerView.xaml.cs │ │ ├── PropertiesView.xaml.cs │ │ ├── LogicalTreeView.xaml.cs │ │ ├── DataContextView.xaml │ │ ├── AnalyzerConfigurationViewModel.cs │ │ ├── AnalyzerConfigurationWindow.xaml.cs │ │ ├── UsageHintViewModel.cs │ │ ├── DataContextViewModel.cs │ │ ├── IssueListView.xaml.cs │ │ ├── BindingEditorWindow.xaml.cs │ │ ├── StyleExplorerViewModel.cs │ │ ├── UsageHintWindow.xaml │ │ ├── AboutWindow.xaml │ │ ├── PropertiesView.xaml │ │ ├── ResourcesView.xaml │ │ ├── ResourceEditor.xaml.cs │ │ ├── LogicalTreeView.xaml │ │ ├── TestWindow.xaml.cs │ │ ├── VisualTreeView.xaml │ │ ├── Helpers │ │ │ ├── XmlHelper.cs │ │ │ ├── ContextMenuHelper.cs │ │ │ └── GridAdorner.cs │ │ ├── LogicalTreeViewModel.cs │ │ ├── AutomationViewModel.cs │ │ ├── UpdateTriggeredTreeItemViewModel.cs │ │ ├── XamlViewModel.cs │ │ ├── TriggerViewModel.cs │ │ ├── ResourceEditor.xaml │ │ ├── TriggerView.xaml │ │ └── EventsView.xaml │ ├── Utilities │ │ ├── EventArgs.cs │ │ ├── AssemblyHelper.cs │ │ ├── EventHandlerExtensions.cs │ │ ├── VisualTreeHelperExtensions.cs │ │ ├── KnownAssemblyNames.cs │ │ └── TreeHelperExtensions.cs │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── app.manifest │ │ └── AssemblyInfo.cs │ ├── Services │ │ ├── Xaml │ │ │ ├── BamlReader │ │ │ │ ├── Resource.cs │ │ │ │ └── BamlLoader.cs │ │ │ └── XamlSource.cs │ │ ├── StyleExplorer │ │ │ └── StyleScope.cs │ │ ├── MethodInjectorService.cs │ │ ├── LoggerService.cs │ │ ├── IProcessService.cs │ │ ├── Triggers │ │ │ ├── EventSetterItem.cs │ │ │ ├── TriggerItem.cs │ │ │ ├── MultiDataTriggerItem.cs │ │ │ ├── DataTriggerItem.cs │ │ │ ├── TriggerItemFactory.cs │ │ │ ├── SetterItem.cs │ │ │ └── MultiTriggerItem.cs │ │ ├── ElementTree │ │ │ ├── VisualTreeService.cs │ │ │ ├── LogicalTreeService.cs │ │ │ ├── DataContextInfo.cs │ │ │ ├── MouseElementServiceSettings.cs │ │ │ ├── PresentationSourceTreeItem.cs │ │ │ ├── AutomationItem.cs │ │ │ ├── ApplicationTreeItem.cs │ │ │ ├── AutomationTreeService.cs │ │ │ ├── LogicalTreeItem.cs │ │ │ └── VisualTreeItem.cs │ │ ├── FocusInfo.cs │ │ ├── Resources │ │ │ ├── DrawingResourceItem.cs │ │ │ ├── GeometryResourceItem.cs │ │ │ ├── ColorResourceItem.cs │ │ │ ├── StyleResourceItem.cs │ │ │ ├── ResourcesService.cs │ │ │ └── BrushResourceItem.cs │ │ ├── Events │ │ │ └── RoutedEventItem.cs │ │ ├── DataContextService.cs │ │ ├── FocusedElementService.cs │ │ ├── ServiceLocator.cs │ │ ├── Resizing │ │ │ ├── SizeItem.cs │ │ │ └── ApplicationResizeService.cs │ │ ├── MainWindowFinder.cs │ │ ├── Analyzers │ │ │ ├── AnalyzerBase.cs │ │ │ ├── Performance │ │ │ │ ├── UnnecessaryNestedPanelsAnalyzer.cs │ │ │ │ └── FreezeFreezablesAnalyzer.cs │ │ │ ├── Issue.cs │ │ │ └── Maintainability │ │ │ │ └── LocalBrushDefinitionsAnalyzer.cs │ │ ├── Theming │ │ │ └── ApplicationThemeItem.cs │ │ ├── ManagedApplicationsInfo.cs │ │ ├── ApplicationSettings.cs │ │ └── Process32Service.cs │ ├── Win32 │ │ └── PlatformHelper.cs │ └── Hook │ │ └── Inspector.cs └── Process32Helper │ ├── ProcessService.cs │ ├── Application.cs │ └── Properties │ └── AssemblyInfo.cs ├── README.md └── .gitattributes /source/Hook32_35/Stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /source/Hook32_40/Stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /source/Hook64_35/Stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /source/Hook64_40/Stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /source/Hook32_35/makefile.def: -------------------------------------------------------------------------------- 1 | LIBRARY "Hook32" 2 | EXPORTS 3 | MessageHookProc @1 4 | -------------------------------------------------------------------------------- /source/Hook32_40/makefile.def: -------------------------------------------------------------------------------- 1 | LIBRARY "Hook32" 2 | EXPORTS 3 | MessageHookProc @1 4 | -------------------------------------------------------------------------------- /source/Hook64_35/makefile.def: -------------------------------------------------------------------------------- 1 | LIBRARY "Hook64" 2 | EXPORTS 3 | MessageHookProc @1 4 | -------------------------------------------------------------------------------- /source/Hook64_40/makefile.def: -------------------------------------------------------------------------------- 1 | LIBRARY "Hook64" 2 | EXPORTS 3 | MessageHookProc @1 4 | -------------------------------------------------------------------------------- /source/Hook32_35/Stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Windows.h" 4 | #include "tchar.h" 5 | -------------------------------------------------------------------------------- /source/Hook32_40/Stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Windows.h" 4 | #include "tchar.h" 5 | -------------------------------------------------------------------------------- /source/Hook64_35/Stdafx.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "Windows.h" 5 | #include "tchar.h" 6 | -------------------------------------------------------------------------------- /source/Hook64_40/Stdafx.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "Windows.h" 5 | #include "tchar.h" 6 | -------------------------------------------------------------------------------- /source/Hook32_35/hook.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Hook32_35/hook.h -------------------------------------------------------------------------------- /source/Hook32_40/hook.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Hook32_40/hook.h -------------------------------------------------------------------------------- /source/Inspector/Images/dll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/dll.png -------------------------------------------------------------------------------- /source/Inspector/Images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/grid.png -------------------------------------------------------------------------------- /source/Inspector/Images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/menu.png -------------------------------------------------------------------------------- /source/Inspector/Images/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/tree.png -------------------------------------------------------------------------------- /source/Inspector/Images/type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/type.png -------------------------------------------------------------------------------- /source/Inspector/Images/xaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/xaml.png -------------------------------------------------------------------------------- /source/Hook32_35/AssemblyInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Hook32_35/AssemblyInfo.cpp -------------------------------------------------------------------------------- /source/Hook32_40/AssemblyInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Hook32_40/AssemblyInfo.cpp -------------------------------------------------------------------------------- /source/Hook64_35/AssemblyInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Hook64_35/AssemblyInfo.cpp -------------------------------------------------------------------------------- /source/Hook64_40/AssemblyInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Hook64_40/AssemblyInfo.cpp -------------------------------------------------------------------------------- /source/Inspector/Images/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/border.png -------------------------------------------------------------------------------- /source/Inspector/Images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/button.png -------------------------------------------------------------------------------- /source/Inspector/Images/canvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/canvas.png -------------------------------------------------------------------------------- /source/Inspector/Images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/clear.png -------------------------------------------------------------------------------- /source/Inspector/Images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/error.png -------------------------------------------------------------------------------- /source/Inspector/Images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/folder.png -------------------------------------------------------------------------------- /source/Inspector/Images/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/group.png -------------------------------------------------------------------------------- /source/Inspector/Images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/image.png -------------------------------------------------------------------------------- /source/Inspector/Images/listbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/listbox.png -------------------------------------------------------------------------------- /source/Inspector/Images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/search.png -------------------------------------------------------------------------------- /source/Inspector/Images/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/slider.png -------------------------------------------------------------------------------- /source/Inspector/Images/sort_az.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/sort_az.png -------------------------------------------------------------------------------- /source/Inspector/Images/textbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/textbox.png -------------------------------------------------------------------------------- /source/Inspector/Images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/warning.png -------------------------------------------------------------------------------- /source/Inspector/Images/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/window.png -------------------------------------------------------------------------------- /source/Inspector/Images/Inspector.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/Inspector.ico -------------------------------------------------------------------------------- /source/Inspector/Images/Inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/Inspector.png -------------------------------------------------------------------------------- /source/Inspector/Images/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/checkbox.png -------------------------------------------------------------------------------- /source/Inspector/Images/combobox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/combobox.png -------------------------------------------------------------------------------- /source/Inspector/Images/dockpanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/dockpanel.png -------------------------------------------------------------------------------- /source/Inspector/Images/expander.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/expander.png -------------------------------------------------------------------------------- /source/Inspector/Images/listview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/listview.png -------------------------------------------------------------------------------- /source/Inspector/Images/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/property.png -------------------------------------------------------------------------------- /source/Inspector/Images/rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/rectangle.png -------------------------------------------------------------------------------- /source/Inspector/Images/resources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/resources.png -------------------------------------------------------------------------------- /source/Inspector/Images/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/separator.png -------------------------------------------------------------------------------- /source/Inspector/Images/textblock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/textblock.png -------------------------------------------------------------------------------- /source/Inspector/Images/datacontext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/datacontext.png -------------------------------------------------------------------------------- /source/Inspector/Images/gridsplitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/gridsplitter.png -------------------------------------------------------------------------------- /source/Inspector/Images/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/information.png -------------------------------------------------------------------------------- /source/Inspector/Images/mediaelement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/mediaelement.png -------------------------------------------------------------------------------- /source/Inspector/Images/passwordbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/passwordbox.png -------------------------------------------------------------------------------- /source/Inspector/Images/progressbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/progressbar.png -------------------------------------------------------------------------------- /source/Inspector/Images/radiobutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/radiobutton.png -------------------------------------------------------------------------------- /source/Inspector/Images/richtextbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/richtextbox.png -------------------------------------------------------------------------------- /source/Inspector/Images/scrollviewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/scrollviewer.png -------------------------------------------------------------------------------- /source/Inspector/Images/stackpanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/stackpanel.png -------------------------------------------------------------------------------- /source/Inspector/Images/tabcontrol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/tabcontrol.png -------------------------------------------------------------------------------- /source/Inspector/Images/contentcontrol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/contentcontrol.png -------------------------------------------------------------------------------- /source/Inspector/Images/field_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/field_private.png -------------------------------------------------------------------------------- /source/Inspector/Images/inspectorlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/inspectorlogo.png -------------------------------------------------------------------------------- /source/Inspector/Images/method_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/method_private.png -------------------------------------------------------------------------------- /source/Inspector/Images/method_public.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/method_public.png -------------------------------------------------------------------------------- /source/Inspector/Images/noprocessicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/noprocessicon.png -------------------------------------------------------------------------------- /source/Inspector/Images/trigger_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/trigger_active.png -------------------------------------------------------------------------------- /source/Inspector/Images/method_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/method_protected.png -------------------------------------------------------------------------------- /source/Inspector/Images/trigger_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/trigger_inactive.png -------------------------------------------------------------------------------- /source/Inspector/Images/inspectorlogo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/Images/inspectorlogo_small.png -------------------------------------------------------------------------------- /source/Hook64_35/hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | __declspec( dllexport ) 4 | int __stdcall MessageHookProc(int nCode, WPARAM wparam, LPARAM lparam); 5 | 6 | -------------------------------------------------------------------------------- /source/Hook64_40/hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | __declspec( dllexport ) 4 | int __stdcall MessageHookProc(int nCode, WPARAM wparam, LPARAM lparam); 5 | 6 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Images/active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/UserInterface/VisualResources/Images/active.png -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Images/inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/UserInterface/VisualResources/Images/inactive.png -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Images/resourceitem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/UserInterface/VisualResources/Images/resourceitem.png -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Images/triggeritem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdurrani/WPF-Inspector/HEAD/source/Inspector/UserInterface/VisualResources/Images/triggeritem.png -------------------------------------------------------------------------------- /source/Inspector/Utilities/EventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ChristianMoser.WpfInspector.Utilities 4 | { 5 | public class EventArgs : EventArgs 6 | { 7 | public T Data { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /source/Inspector/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WPF-Inspector 2 | A fork of WPF inspector I created to fix a crash I ran into 3 | 4 | # License 5 | The licnse is MS-PL, same as WPF Inspector 6 | 7 | All credits and praise go to the original author of WPF Inspector 8 | 9 | https://wpfinspector.codeplex.com/ 10 | -------------------------------------------------------------------------------- /source/Inspector/Services/Xaml/BamlReader/Resource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ChristianMoser.WpfInspector.Baml 4 | { 5 | internal class Resource 6 | { 7 | public Exception Exception { get; set; } 8 | public string Name { get; set; } 9 | public object Value { get; set; } 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /source/Inspector/Services/StyleExplorer/StyleScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ChristianMoser.WpfInspector.Services.StyleExplorer 7 | { 8 | public enum StyleScope 9 | { 10 | Local, 11 | Application, 12 | Theme 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /source/Inspector/Services/MethodInjectorService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Diagnostics; 6 | 7 | namespace ChristianMoser.WpfInspector.Services 8 | { 9 | public class MethodInjectorService 10 | { 11 | //public void ExecuteMethodInProcess( Process p, Assembly) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/AutomationTreeView.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/PropertyItems/BrushPropertyItem.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface.Controls.PropertyItems 4 | { 5 | public class BrushPropertyItem : PropertyItem 6 | { 7 | public BrushPropertyItem(PropertyDescriptor property, object instance) 8 | : base( property, instance) 9 | { 10 | 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/EventsView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface 4 | { 5 | /// 6 | /// Interaction logic for EventsView.xaml 7 | /// 8 | public partial class EventsView : UserControl 9 | { 10 | public EventsView() 11 | { 12 | InitializeComponent(); 13 | DataContext = new EventsViewModel(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/UsageHintWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface 4 | { 5 | /// 6 | /// Interaction logic for UsageHintWindow.xaml 7 | /// 8 | public partial class UsageHintWindow : Window 9 | { 10 | public UsageHintWindow() 11 | { 12 | InitializeComponent(); 13 | DataContext = new UsageHintViewModel(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Converters/ValueConverterBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Markup; 6 | 7 | namespace ChristianMoser.WpfInspector.UserInterface.Converters 8 | { 9 | public class ValueConverterBase : MarkupExtension 10 | { 11 | public override object ProvideValue(IServiceProvider serviceProvider) 12 | { 13 | return this; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source/Inspector/Services/LoggerService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ChristianMoser.WpfInspector.Services 7 | { 8 | public enum LogSeverity 9 | { 10 | Info, 11 | Warning, 12 | Error 13 | } 14 | 15 | public class LoggerService 16 | { 17 | public void Log( LogSeverity severity, Exception exception) 18 | { 19 | 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/DataContextView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface 4 | { 5 | /// 6 | /// Interaction logic for DataContextWindow.xaml 7 | /// 8 | public partial class DataContextView : UserControl 9 | { 10 | public DataContextView() 11 | { 12 | InitializeComponent(); 13 | DataContext = new DataContextViewModel(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source/Inspector/Utilities/AssemblyHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | 5 | namespace ChristianMoser.WpfInspector.Utilities 6 | { 7 | public static class AssemblyHelper 8 | { 9 | public static Assembly FindAssemblyByPartialName(string partialName) 10 | { 11 | return AppDomain.CurrentDomain.GetAssemblies().Where(a => a.GetName().Name.ToLower().Contains(partialName.ToLower())).FirstOrDefault(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/PropertyItems/BooleanPropertyItem.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface.Controls.PropertyItems 4 | { 5 | public class BooleanPropertyItem : PropertyItem 6 | { 7 | #region Construction 8 | 9 | public BooleanPropertyItem(PropertyDescriptor property, object instance) 10 | :base(property, instance) 11 | { 12 | 13 | } 14 | 15 | #endregion 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/AutomationTreeView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface 4 | { 5 | /// 6 | /// Interaction logic for UiAutomationTreeView.xaml 7 | /// 8 | public partial class AutomationTreeView : UserControl 9 | { 10 | public AutomationTreeView() 11 | { 12 | InitializeComponent(); 13 | DataContext = new AutomationViewModel(); 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using ChristianMoser.WpfInspector.Services; 3 | 4 | namespace ChristianMoser.WpfInspector.UserInterface 5 | { 6 | /// 7 | /// Interaction logic for App.xaml 8 | /// 9 | public partial class App : Application 10 | { 11 | 12 | protected override void OnExit(ExitEventArgs e) 13 | { 14 | ServiceLocator.Resolve().Dispose(); 15 | base.OnExit(e); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualTreeView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | using ChristianMoser.WpfInspector.Services.ElementTree; 3 | 4 | namespace ChristianMoser.WpfInspector.UserInterface 5 | { 6 | /// 7 | /// Interaction logic for VisualTreeView.xaml 8 | /// 9 | public partial class VisualTreeView : UserControl 10 | { 11 | public VisualTreeView() 12 | { 13 | InitializeComponent(); 14 | DataContext = new VisualTreeViewModel(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/Inspector/Services/IProcessService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ServiceModel; 3 | 4 | namespace ChristianMoser.WpfInspector.Services 5 | { 6 | [ServiceContract] 7 | public interface IProcessService 8 | { 9 | /// 10 | /// Gets the process infos. 11 | /// 12 | /// 13 | [OperationContract] 14 | List GetProcessInfos(); 15 | 16 | [OperationContract] 17 | string Inspect(ManagedApplicationInfo applicationInfo); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/Inspector/Services/Triggers/EventSetterItem.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ChristianMoser.WpfInspector.Services.Triggers 4 | { 5 | /// 6 | /// Abstraction model of a 7 | /// 8 | public class EventSetterItem 9 | { 10 | public EventSetterItem(string eventName, string handler) 11 | { 12 | EventName = eventName; 13 | Handler = handler; 14 | } 15 | 16 | public string EventName { get; private set; } 17 | public string Handler { get; private set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/Inspector/Services/ElementTree/VisualTreeService.cs: -------------------------------------------------------------------------------- 1 | namespace ChristianMoser.WpfInspector.Services.ElementTree 2 | { 3 | /// 4 | /// Service to browse the visual tree 5 | /// 6 | public class VisualTreeService : TreeElementService 7 | { 8 | #region Construction 9 | 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | public VisualTreeService() 14 | : base(TreeType.VisualTree) 15 | { 16 | } 17 | 18 | #endregion 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /source/Inspector/Services/ElementTree/LogicalTreeService.cs: -------------------------------------------------------------------------------- 1 | namespace ChristianMoser.WpfInspector.Services.ElementTree 2 | { 3 | /// 4 | /// Service to browse the logical tree 5 | /// 6 | public class LogicalTreeService : TreeElementService 7 | { 8 | #region Construction 9 | 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | public LogicalTreeService() 14 | : base(TreeType.LogicalTree) 15 | { 16 | } 17 | 18 | #endregion 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/AboutWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ChristianMoser.WpfInspector.UserInterface 4 | { 5 | /// 6 | /// Interaction logic for AboutWindow.xaml 7 | /// 8 | public partial class AboutWindow : Window 9 | { 10 | #region Construction 11 | 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public AboutWindow() 16 | { 17 | InitializeComponent(); 18 | closeButton.Click += (s, e) => Close(); 19 | } 20 | 21 | #endregion 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source/Inspector/Services/FocusInfo.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows; 3 | using ChristianMoser.WpfInspector.Utilities; 4 | 5 | namespace ChristianMoser.WpfInspector.Services 6 | { 7 | public class FocusInfo : INotifyPropertyChanged 8 | { 9 | private FrameworkElement _keyboardFocusElement; 10 | 11 | public FrameworkElement KeyboardFocusElement 12 | { 13 | get { return _keyboardFocusElement; } 14 | set { PropertyChanged.ChangeAndNotify(ref _keyboardFocusElement, value, this, "KeyboardFocusElement"); } 15 | } 16 | 17 | public event PropertyChangedEventHandler PropertyChanged; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/PropertyItems/IPropertyItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ChristianMoser.WpfInspector.UserInterface.Controls.PropertyItems 8 | { 9 | public interface IPropertyGridItem : IDisposable, INotifyPropertyChanged 10 | { 11 | /// 12 | /// Gets the name. 13 | /// 14 | /// The name. 15 | string Name { get; } 16 | 17 | /// 18 | /// Gets if the property item is selected 19 | /// 20 | bool IsSelected { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/XamlView.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source/Inspector/Services/Resources/DrawingResourceItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ChristianMoser.WpfInspector.Services.Resources 8 | { 9 | public class DrawingResourceItem : ResourceItem 10 | { 11 | public DrawingResourceItem(object resourceKey, ResourceDictionary dictionary, FrameworkElement source, ResourceScope scope) 12 | :base( resourceKey, dictionary, source,scope) 13 | { 14 | 15 | } 16 | 17 | public override string Category 18 | { 19 | get 20 | { 21 | return "Drawings"; 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /source/Inspector/Utilities/EventHandlerExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ChristianMoser.WpfInspector.Utilities 4 | { 5 | public static class EventHandlerExtensions 6 | { 7 | /// 8 | /// Notifies all receivers of a given handler 9 | /// that a property with specific name has changed. 10 | /// 11 | /// The handler. 12 | /// The sender. 13 | public static void Notify(this EventHandler handler, object sender, EventArgs e) 14 | { 15 | if (handler != null) 16 | { 17 | handler(sender, e); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /source/Inspector/Utilities/VisualTreeHelperExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Media; 7 | 8 | namespace ChristianMoser.WpfInspector.Utilities 9 | { 10 | public static class VisualTreeHelperExtensions 11 | { 12 | public static T FindAncestor(this DependencyObject dependencyObject) 13 | where T : class 14 | { 15 | DependencyObject target = dependencyObject; 16 | do 17 | { 18 | target = VisualTreeHelper.GetParent(target); 19 | } 20 | while (target != null && !(target is T)); 21 | return target as T; 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/SelectorWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Input; 3 | 4 | namespace ChristianMoser.WpfInspector.UserInterface 5 | { 6 | /// 7 | /// Interaction logic for SelectorWindow.xaml 8 | /// 9 | public partial class SelectorWindow : Window 10 | { 11 | private readonly SelectorWindowViewModel _viewModel = new SelectorWindowViewModel(); 12 | 13 | public SelectorWindow() 14 | { 15 | InitializeComponent(); 16 | DataContext = _viewModel; 17 | } 18 | 19 | private void ListBoxMouseDoubleClick(object sender, MouseButtonEventArgs e) 20 | { 21 | _viewModel.InspectCommand.Execute(null); 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /source/Inspector/Utilities/KnownAssemblyNames.cs: -------------------------------------------------------------------------------- 1 | namespace ChristianMoser.WpfInspector.Utilities 2 | { 3 | public static class KnownAssemblyNames 4 | { 5 | public const string PresentationFrameworkAero = "PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; 6 | public const string PresentationFrameworkClassic = "PresentationFramework.Classic, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; 7 | public const string PresentationFrameworkLuna = "PresentationFramework.Luna, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; 8 | public const string PresentationFrameworkRoyale = "PresentationFramework.Royale, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/XamlView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace ChristianMoser.WpfInspector.UserInterface 16 | { 17 | /// 18 | /// Interaction logic for XamlView.xaml 19 | /// 20 | public partial class XamlView : UserControl 21 | { 22 | public XamlView() 23 | { 24 | InitializeComponent(); 25 | DataContext = new XamlViewModel(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/TriggerView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace ChristianMoser.WpfInspector.UserInterface 16 | { 17 | /// 18 | /// Interaction logic for TemplateView.xaml 19 | /// 20 | public partial class TriggerView : UserControl 21 | { 22 | public TriggerView() 23 | { 24 | InitializeComponent(); 25 | DataContext = new TriggerViewModel(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Controls/Separator.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/ResourcesView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace ChristianMoser.WpfInspector.UserInterface 16 | { 17 | /// 18 | /// Interaction logic for ResourcesView.xaml 19 | /// 20 | public partial class ResourcesView : UserControl 21 | { 22 | public ResourcesView() 23 | { 24 | InitializeComponent(); 25 | DataContext = new ResourcesViewModel(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Converters/EnumValuesConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | using System.Globalization; 7 | 8 | namespace ChristianMoser.WpfInspector.UserInterface.Converters 9 | { 10 | public class EnumValuesConverter : ValueConverterBase, IValueConverter 11 | { 12 | #region IValueConverter Members 13 | 14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 15 | { 16 | return Enum.GetValues(value.GetType()); 17 | } 18 | 19 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | throw new NotSupportedException(); 22 | } 23 | 24 | #endregion 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Controls/ToolTip.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/StyleExplorerView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace ChristianMoser.WpfInspector.UserInterface 16 | { 17 | /// 18 | /// Interaction logic for StyleExplorerView.xaml 19 | /// 20 | public partial class StyleExplorerView : UserControl 21 | { 22 | public StyleExplorerView() 23 | { 24 | InitializeComponent(); 25 | DataContext = new StyleExplorerViewModel(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Converters/BoolInverterConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | 4 | namespace ChristianMoser.WpfInspector.UserInterface.Converters 5 | { 6 | 7 | public class BoolInverterConverter : ValueConverterBase, IValueConverter 8 | { 9 | #region IValueConverter Members 10 | 11 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 12 | { 13 | if (value is bool) 14 | { 15 | return !((bool)value); 16 | } 17 | return value; 18 | } 19 | 20 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source/Inspector/Win32/PlatformHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace ChristianMoser.WpfInspector.Win32 5 | { 6 | public class PlatformHelper 7 | { 8 | public static readonly bool Is64BitProcess = (IntPtr.Size == 8); 9 | 10 | [MethodImpl(MethodImplOptions.NoInlining)] 11 | public static bool IsWow64Process(IntPtr processHandle) 12 | { 13 | if ((Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1) || 14 | Environment.OSVersion.Version.Major >= 6) 15 | { 16 | bool retVal; 17 | if (!NativeMethods.IsWow64Process(processHandle, out retVal)) 18 | { 19 | return false; 20 | } 21 | return retVal; 22 | } 23 | return false; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/Process32Helper/ProcessService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ChristianMoser.WpfInspector.Services; 3 | 4 | namespace ChristianMoser.WpfInspector.Process32Helper 5 | { 6 | public class ProcessService : IProcessService 7 | { 8 | #region IProcessService Members 9 | 10 | public List GetProcessInfos() 11 | { 12 | var applicationsService = ServiceLocator.Resolve(); 13 | var processes = new List(); 14 | processes.AddRange(applicationsService.GetManagedApplications()); 15 | return processes; 16 | } 17 | 18 | public string Inspect(ManagedApplicationInfo applicationInfo) 19 | { 20 | return ServiceLocator.Resolve().Inspect(applicationInfo); 21 | } 22 | 23 | #endregion 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/PropertiesView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using ChristianMoser.WpfInspector.Services; 15 | 16 | namespace ChristianMoser.WpfInspector.UserInterface 17 | { 18 | /// 19 | /// Interaction logic for PropertyGrid.xaml 20 | /// 21 | public partial class PropertiesView : UserControl 22 | { 23 | public PropertiesView() 24 | { 25 | InitializeComponent(); 26 | var viewModel = new PropertiesViewModel(); 27 | DataContext = viewModel; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/LogicalTreeView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using ChristianMoser.WpfInspector.Services.DataObjects; 15 | using ChristianMoser.WpfInspector.Services.ElementTree; 16 | 17 | namespace ChristianMoser.WpfInspector.UserInterface 18 | { 19 | /// 20 | /// Interaction logic for LogicalTreeView.xaml 21 | /// 22 | public partial class LogicalTreeView : UserControl 23 | { 24 | public LogicalTreeView() 25 | { 26 | InitializeComponent(); 27 | DataContext = new LogicalTreeViewModel(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /source/Inspector/Services/Events/RoutedEventItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ChristianMoser.WpfInspector.Services.Events 8 | { 9 | public class RoutedEventItem 10 | { 11 | #region Private Members 12 | 13 | private readonly RoutedEventArgs _eventArgs; 14 | 15 | #endregion 16 | 17 | #region Construction 18 | 19 | /// 20 | /// Initializes a new instance of the class. 21 | /// 22 | public RoutedEventItem(RoutedEventArgs eventArgs) 23 | { 24 | _eventArgs = eventArgs; 25 | } 26 | 27 | #endregion 28 | 29 | /// 30 | /// Gets the name of the routed event 31 | /// 32 | public string Name 33 | { 34 | get { return _eventArgs.RoutedEvent.Name; } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /source/Inspector/Hook/Inspector.cs: -------------------------------------------------------------------------------- 1 | using ChristianMoser.WpfInspector.UserInterface; 2 | using System; 3 | using System.Windows; 4 | using ChristianMoser.WpfInspector.Services; 5 | namespace ChristianMoser.WpfInspector.Hook 6 | { 7 | public class Inspector 8 | { 9 | public static void Inject() 10 | { 11 | AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; 12 | var inspectorWinow = new InspectorWindow(); 13 | ServiceLocator.RegisterInstance(inspectorWinow); 14 | if (Application.Current != null && Application.Current.MainWindow != null) 15 | { 16 | inspectorWinow.Owner = Application.Current.MainWindow; 17 | } 18 | inspectorWinow.Show(); 19 | } 20 | 21 | static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) 22 | { 23 | MessageBox.Show(((Exception) e.ExceptionObject).Message); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/DataContextView.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source/Inspector/Services/Resources/GeometryResourceItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ChristianMoser.WpfInspector.Services.Resources 8 | { 9 | public class GeometryResourceItem : ResourceItem 10 | { 11 | #region Construction 12 | 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public GeometryResourceItem(object resourceKey, ResourceDictionary dictionary, FrameworkElement source, ResourceScope scope) 17 | :base( resourceKey, dictionary,source, scope) 18 | { 19 | 20 | } 21 | 22 | #endregion 23 | 24 | /// 25 | /// Gets the category. 26 | /// 27 | public override string Category 28 | { 29 | get 30 | { 31 | return "Geometries"; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /source/Inspector/Services/ElementTree/DataContextInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | using ChristianMoser.WpfInspector.Utilities; 7 | 8 | namespace ChristianMoser.WpfInspector.Services.DataObjects 9 | { 10 | public class DataContextInfo : INotifyPropertyChanged 11 | { 12 | private object _dataContext; 13 | 14 | public bool IsNull 15 | { 16 | get { return DataContext == null; } 17 | } 18 | 19 | public object DataContext 20 | { 21 | get { return _dataContext; } 22 | set 23 | { 24 | PropertyChanged.ChangeAndNotify(ref _dataContext, value, this, "DataContext"); 25 | PropertyChanged.Notify(this, "IsNull"); 26 | } 27 | } 28 | 29 | #region INotifyPropertyChanged Members 30 | 31 | public event PropertyChangedEventHandler PropertyChanged; 32 | 33 | #endregion 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /source/Inspector/Utilities/TreeHelperExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Media; 3 | 4 | namespace ChristianMoser.WpfInspector.Utilities 5 | { 6 | public static class TreeHelperExtensions 7 | { 8 | public static T FindVisualAncestor(this DependencyObject dependencyObject) 9 | where T : class 10 | { 11 | DependencyObject target = dependencyObject; 12 | do 13 | { 14 | target = VisualTreeHelper.GetParent(target); 15 | } 16 | while (target != null && !(target is T)); 17 | return target as T; 18 | } 19 | 20 | public static T FindLogicalAncestor(this DependencyObject dependencyObject) 21 | where T : class 22 | { 23 | DependencyObject target = dependencyObject; 24 | do 25 | { 26 | target = LogicalTreeHelper.GetParent(target); 27 | } 28 | while (target != null && !(target is T)); 29 | return target as T; 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /source/Inspector/Services/Xaml/XamlSource.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using ChristianMoser.WpfInspector.Baml; 3 | 4 | namespace ChristianMoser.WpfInspector.Services.Xaml 5 | { 6 | public class XamlSource 7 | { 8 | #region Private Members 9 | 10 | private string _xaml; 11 | private readonly Stream _bamlStream; 12 | 13 | #endregion 14 | 15 | #region Construction 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public XamlSource(Stream bamlStream) 21 | { 22 | _bamlStream = bamlStream; 23 | } 24 | 25 | #endregion 26 | 27 | /// 28 | /// Gets the xaml. 29 | /// 30 | public string Xaml 31 | { 32 | get 33 | { 34 | if (_xaml == null) 35 | { 36 | _xaml = new BamlTranslator(_bamlStream).ToString(); 37 | } 38 | return _xaml; 39 | } 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/AnalyzerConfigurationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | using ChristianMoser.WpfInspector.Services; 7 | using System.ComponentModel; 8 | using ChristianMoser.WpfInspector.Services.Analyzers; 9 | 10 | namespace ChristianMoser.WpfInspector.UserInterface 11 | { 12 | public class AnalyzerConfigurationViewModel 13 | { 14 | private readonly IssuesAnalyzerService _issuesAnalyzer; 15 | 16 | public AnalyzerConfigurationViewModel() 17 | { 18 | _issuesAnalyzer = ServiceLocator.Resolve(); 19 | Analyzers = new ListCollectionView(_issuesAnalyzer.AnalyzerContext.Analyzers); 20 | Analyzers.GroupDescriptions.Add(new PropertyGroupDescription("Category")); 21 | Analyzers.MoveCurrentToFirst(); 22 | } 23 | 24 | public ICollectionView Analyzers { get; private set; } 25 | 26 | public void ReAnalyze() 27 | { 28 | _issuesAnalyzer.Analyze(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /source/Process32Helper/Application.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ServiceModel; 3 | using System.Threading; 4 | using ChristianMoser.WpfInspector.Services; 5 | 6 | namespace ChristianMoser.WpfInspector.Process32Helper 7 | { 8 | public static class Application 9 | { 10 | /// 11 | /// Static application entry point 12 | /// 13 | /// The args. 14 | public static void Main( string[] args) 15 | { 16 | // Start a serivce host to query 32-bit processes 17 | try 18 | { 19 | var host = new ServiceHost(typeof(ProcessService)); 20 | host.AddServiceEndpoint(typeof(IProcessService), new NetNamedPipeBinding(), Process32Service.ProcessServiceAddress); 21 | host.Open(); 22 | 23 | // Wait forever 24 | var evt = new AutoResetEvent(false); 25 | evt.WaitOne(); 26 | } 27 | catch (AddressAlreadyInUseException) 28 | { 29 | } 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /source/Hook32_35/Hook32_35.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /source/Hook32_40/Hook32_40.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /source/Hook64_35/Hook64_35.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /source/Hook64_40/Hook64_40.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/SearchTextBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Controls; 6 | using System.Windows.Input; 7 | using ChristianMoser.WpfInspector.Utilities; 8 | 9 | namespace ChristianMoser.WpfInspector.UserInterface.Controls 10 | { 11 | public class SearchTextBox : TextBox 12 | { 13 | public Command ClearTextCommand { get; private set; } 14 | 15 | public SearchTextBox() 16 | { 17 | ClearTextCommand = new Command(o => Text = string.Empty, o => !string.IsNullOrEmpty(Text)); 18 | } 19 | 20 | protected override void OnKeyUp(KeyEventArgs e) 21 | { 22 | if( e.Key == Key.Escape) 23 | { 24 | MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); 25 | } 26 | base.OnKeyUp(e); 27 | } 28 | 29 | protected override void OnTextChanged(TextChangedEventArgs e) 30 | { 31 | ClearTextCommand.RaiseCanExecuteChanged(); 32 | base.OnTextChanged(e); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/AnalyzerConfigurationWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace ChristianMoser.WpfInspector.UserInterface 15 | { 16 | /// 17 | /// Interaction logic for AnalyzerConfigurationWindow.xaml 18 | /// 19 | public partial class AnalyzerConfigurationWindow : Window 20 | { 21 | private readonly AnalyzerConfigurationViewModel _viewModel; 22 | 23 | public AnalyzerConfigurationWindow() 24 | { 25 | InitializeComponent(); 26 | _viewModel = new AnalyzerConfigurationViewModel(); 27 | DataContext =_viewModel; 28 | } 29 | 30 | private void Button_Click(object sender, RoutedEventArgs e) 31 | { 32 | Close(); 33 | _viewModel.ReAnalyze(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /source/Inspector/Services/Triggers/TriggerItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Windows; 4 | 5 | namespace ChristianMoser.WpfInspector.Services.Triggers 6 | { 7 | public class TriggerItem : TriggerItemBase 8 | { 9 | #region Private Members 10 | 11 | private readonly Trigger _trigger; 12 | private readonly FrameworkElement _source; 13 | 14 | #endregion 15 | 16 | #region Construction 17 | 18 | public TriggerItem(Trigger trigger, FrameworkElement source, TriggerSource triggerSource) 19 | : base(source, TriggerType.Trigger, triggerSource) 20 | { 21 | _trigger = trigger; 22 | _source = source; 23 | } 24 | 25 | #endregion 26 | 27 | protected override IEnumerable GetSetters() 28 | { 29 | return _trigger.Setters.Select(s => new SetterItem(s, _source)); 30 | } 31 | 32 | protected override IEnumerable GetConditions() 33 | { 34 | yield return new ConditionItem(_trigger.Property, Instance, _trigger.Value); 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/Inspector/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ChristianMoser.WpfInspector.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/Inspector/Services/DataContextService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ChristianMoser.WpfInspector.Services.DataObjects; 3 | using ChristianMoser.WpfInspector.Services.ElementTree; 4 | using ChristianMoser.WpfInspector.Utilities; 5 | using System.Windows; 6 | using System.Windows.Threading; 7 | 8 | namespace ChristianMoser.WpfInspector.Services 9 | { 10 | public class DataContextService 11 | { 12 | #region Private Members 13 | 14 | private readonly DataContextInfo _dataContextInfo = new DataContextInfo(); 15 | 16 | #endregion 17 | 18 | public DataContextInfo DataContextInfo 19 | { 20 | get { return _dataContextInfo; } 21 | } 22 | 23 | public void UpdateDataContext(TreeItem treeItem) 24 | { 25 | if (treeItem != null) 26 | { 27 | var fe = treeItem.Instance as FrameworkElement; 28 | if (fe != null && fe.DataContext != null) 29 | { 30 | _dataContextInfo.DataContext = fe.DataContext; 31 | return; 32 | } 33 | } 34 | _dataContextInfo.DataContext = null; 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/Inspector/Services/FocusedElementService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Input; 6 | using System.Windows.Threading; 7 | using System.Windows; 8 | 9 | namespace ChristianMoser.WpfInspector.Services 10 | { 11 | public class FocusedElementService 12 | { 13 | private readonly DispatcherTimer _timer; 14 | private FocusInfo _info = new FocusInfo(); 15 | 16 | public FocusedElementService() 17 | { 18 | _timer = new DispatcherTimer {Interval = TimeSpan.FromMilliseconds(300)}; 19 | _timer.Tick += OnTimerTick; 20 | _timer.Start(); 21 | } 22 | 23 | public FocusInfo Info 24 | { 25 | get { return _info; } 26 | } 27 | 28 | private void OnTimerTick(object sender, EventArgs e) 29 | { 30 | var keyboardFocusElement = Keyboard.FocusedElement; 31 | if( !ReferenceEquals(keyboardFocusElement, Info.KeyboardFocusElement)) 32 | { 33 | Info.KeyboardFocusElement = keyboardFocusElement as FrameworkElement; 34 | } 35 | } 36 | 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/VisualResources/Controls/XamlTextBlock.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 21 | 22 | -------------------------------------------------------------------------------- /source/Inspector/Services/Triggers/MultiDataTriggerItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ChristianMoser.WpfInspector.Services.Triggers 8 | { 9 | public class MultiDataTriggerItem : TriggerItemBase 10 | { 11 | private readonly MultiDataTrigger _trigger; 12 | private readonly FrameworkElement _source; 13 | 14 | public MultiDataTriggerItem(MultiDataTrigger trigger, FrameworkElement source, TriggerSource triggerSource) 15 | : base(source, TriggerType.MultiDataTrigger, triggerSource) 16 | { 17 | _trigger = trigger; 18 | _source = source; 19 | } 20 | 21 | protected override IEnumerable GetSetters() 22 | { 23 | return _trigger.Setters.Select(s => new SetterItem(s, _source)); 24 | } 25 | 26 | protected override IEnumerable GetConditions() 27 | { 28 | foreach (var condition in _trigger.Conditions) 29 | { 30 | yield return new ConditionItem(condition.Binding, Instance, condition.Value); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/UpdateTrigger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | 7 | namespace ChristianMoser.WpfInspector.UserInterface.Controls 8 | { 9 | public class UpdateTrigger 10 | { 11 | private bool _isUpdateRequired; 12 | 13 | public event EventHandler IsUpdateRequiredChanged; 14 | 15 | public bool IsUpdateRequired 16 | { 17 | get { return _isUpdateRequired; } 18 | set 19 | { 20 | _isUpdateRequired = value; 21 | OnIsUpdateRequiredChanged(); 22 | } 23 | } 24 | 25 | public Action UpdateAction { get; set; } 26 | 27 | public void Update() 28 | { 29 | if( UpdateAction != null) 30 | { 31 | UpdateAction(); 32 | } 33 | IsUpdateRequired = false; 34 | } 35 | 36 | private void OnIsUpdateRequiredChanged() 37 | { 38 | if( IsUpdateRequiredChanged != null) 39 | { 40 | IsUpdateRequiredChanged(this, EventArgs.Empty); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/UsageHintViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Microsoft.Win32; 6 | 7 | namespace ChristianMoser.WpfInspector.UserInterface 8 | { 9 | public class UsageHintViewModel 10 | { 11 | #region Private Members 12 | 13 | private bool _dontShowHintAgaing; 14 | 15 | #endregion 16 | 17 | /// 18 | /// Gets or sets a value indicating whether [dont show hint againg]. 19 | /// 20 | /// true if [dont show hint againg]; otherwise, false. 21 | public bool DontShowHintAgaing 22 | { 23 | get { return _dontShowHintAgaing; } 24 | set 25 | { 26 | _dontShowHintAgaing = value; 27 | UpdateRegistry(); 28 | } 29 | } 30 | 31 | private void UpdateRegistry() 32 | { 33 | try 34 | { 35 | Registry.SetValue(@"HKEY_CURRENT_USER\Software\WPFInspector","DontShowUsageHint", "true"); 36 | } 37 | catch (Exception) 38 | { 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/ItemControl.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | using System.Windows.Markup; 4 | 5 | namespace ChristianMoser.WpfInspector.UserInterface.Controls 6 | { 7 | public enum ItemType 8 | { 9 | Resource, 10 | Trigger, 11 | Setter, 12 | Style 13 | } 14 | 15 | [ContentProperty("Content")] 16 | public class ItemControl : HeaderedContentControl 17 | { 18 | 19 | #region Dependency Property ItemType 20 | 21 | /// 22 | /// Gets or sets the type of the item. 23 | /// 24 | public ItemType ItemType 25 | { 26 | get { return (ItemType)GetValue(ItemTypeProperty); } 27 | set { SetValue(ItemTypeProperty, value); } 28 | } 29 | 30 | /// 31 | /// Registers a dependency property to get or set the item type 32 | /// 33 | public static readonly DependencyProperty ItemTypeProperty = 34 | DependencyProperty.Register("ItemType", typeof(ItemType), typeof(ItemControl), 35 | new FrameworkPropertyMetadata(Controls.ItemType.Resource)); 36 | 37 | #endregion 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /source/Inspector/Services/Resources/ColorResourceItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Media; 7 | 8 | namespace ChristianMoser.WpfInspector.Services.Resources 9 | { 10 | public class ColorResourceItem : ResourceItem 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public ColorResourceItem(object resourceKey, ResourceDictionary dictionary, FrameworkElement source, ResourceScope scope) 16 | :base( resourceKey, dictionary,source, scope) 17 | { 18 | 19 | } 20 | 21 | public override object Value 22 | { 23 | get 24 | { 25 | return new SolidColorBrush((Color) base.Value); 26 | } 27 | } 28 | 29 | /// 30 | /// Gets the category. 31 | /// 32 | /// The category. 33 | public override string Category 34 | { 35 | get 36 | { 37 | return "Colors"; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Converters/LevelToIndentConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | using System.Globalization; 4 | using System.Windows; 5 | 6 | namespace ChristianMoser.WpfInspector.UserInterface.Converters 7 | { 8 | /// 9 | /// Converts the indention level to a left-margin value 10 | /// 11 | public class LevelToMarginConverter : ValueConverterBase, IValueConverter 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public LevelToMarginConverter() 17 | { 18 | } 19 | 20 | #region IValueConverter Members 21 | 22 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 23 | { 24 | if (value is int) 25 | { 26 | return new Thickness(((int)value*16), 0, 0, 0); 27 | } 28 | return value; 29 | } 30 | 31 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 32 | { 33 | throw new NotImplementedException(); 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/Hook32_35/Injector.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "hook.h" 3 | #include 4 | 5 | static unsigned int WM_INSPECT = ::RegisterWindowMessage(L"WM_INSPECT"); 6 | static HHOOK _messageHookHandle; 7 | 8 | __declspec( dllexport ) 9 | int __stdcall MessageHookProc(int nCode, WPARAM wparam, LPARAM lparam) { 10 | 11 | if (nCode == HC_ACTION) 12 | { 13 | CWPSTRUCT* msg = (CWPSTRUCT*)lparam; 14 | if (msg != NULL && msg->message == WM_INSPECT) 15 | { 16 | wchar_t* acmRemote = (wchar_t*)msg->wParam; 17 | 18 | System::String^ acmLocal = gcnew System::String(acmRemote); 19 | cli::array^ acmSplit = acmLocal->Split('$'); 20 | 21 | System::Reflection::Assembly^ assembly = System::Reflection::Assembly::LoadFile(acmSplit[0]); 22 | if (assembly != nullptr) 23 | { 24 | System::Type^ type = assembly->GetType(acmSplit[1]); 25 | if (type != nullptr) 26 | { 27 | System::Reflection::MethodInfo^ methodInfo = type->GetMethod(acmSplit[2], System::Reflection::BindingFlags::Static | System::Reflection::BindingFlags::Public); 28 | if (methodInfo != nullptr) 29 | { 30 | methodInfo->Invoke(nullptr, nullptr); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | return CallNextHookEx(_messageHookHandle, nCode, wparam, lparam); 37 | } -------------------------------------------------------------------------------- /source/Hook32_40/Injector.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "hook.h" 3 | #include 4 | 5 | static unsigned int WM_INSPECT = ::RegisterWindowMessage(L"WM_INSPECT"); 6 | static HHOOK _messageHookHandle; 7 | 8 | __declspec( dllexport ) 9 | int __stdcall MessageHookProc(int nCode, WPARAM wparam, LPARAM lparam) { 10 | 11 | if (nCode == HC_ACTION) 12 | { 13 | CWPSTRUCT* msg = (CWPSTRUCT*)lparam; 14 | if (msg != NULL && msg->message == WM_INSPECT) 15 | { 16 | wchar_t* acmRemote = (wchar_t*)msg->wParam; 17 | 18 | System::String^ acmLocal = gcnew System::String(acmRemote); 19 | cli::array^ acmSplit = acmLocal->Split('$'); 20 | 21 | System::Reflection::Assembly^ assembly = System::Reflection::Assembly::LoadFile(acmSplit[0]); 22 | if (assembly != nullptr) 23 | { 24 | System::Type^ type = assembly->GetType(acmSplit[1]); 25 | if (type != nullptr) 26 | { 27 | System::Reflection::MethodInfo^ methodInfo = type->GetMethod(acmSplit[2], System::Reflection::BindingFlags::Static | System::Reflection::BindingFlags::Public); 28 | if (methodInfo != nullptr) 29 | { 30 | methodInfo->Invoke(nullptr, nullptr); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | return CallNextHookEx(_messageHookHandle, nCode, wparam, lparam); 37 | } -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Controls/PropertyItems/PropertyItemHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | 4 | namespace ChristianMoser.WpfInspector.UserInterface.Controls.PropertyItems 5 | { 6 | public static class PropertyItemHelper 7 | { 8 | public static readonly DependencyProperty BringIntoViewProperty = DependencyProperty.RegisterAttached("BringIntoView", 9 | typeof(bool), typeof(PropertyItemHelper), 10 | new FrameworkPropertyMetadata(false, OnBringIntoViewChanged)); 11 | 12 | public static void SetBringIntoView(UIElement element, bool value) 13 | { 14 | element.SetValue(BringIntoViewProperty, value); 15 | } 16 | 17 | public static bool GetBringIntoView(UIElement element) 18 | { 19 | return (bool)element.GetValue(BringIntoViewProperty); 20 | } 21 | 22 | public static void OnBringIntoViewChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) 23 | { 24 | var contentPresenter = sender as ContentPresenter; 25 | if ((bool)e.NewValue && contentPresenter != null) 26 | { 27 | contentPresenter.BringIntoView(); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/DataContextViewModel.cs: -------------------------------------------------------------------------------- 1 | using ChristianMoser.WpfInspector.Services; 2 | using ChristianMoser.WpfInspector.Services.DataObjects; 3 | using ChristianMoser.WpfInspector.Services.ElementTree; 4 | using ChristianMoser.WpfInspector.UserInterface.Controls; 5 | 6 | namespace ChristianMoser.WpfInspector.UserInterface 7 | { 8 | public class DataContextViewModel 9 | { 10 | private readonly DataContextService _dataContextService; 11 | private readonly UpdateTrigger _updateTrigger = new UpdateTrigger(); 12 | 13 | public DataContextViewModel() 14 | { 15 | var selectedTreeItemService = ServiceLocator.Resolve(); 16 | selectedTreeItemService.SelectedTreeItemChanged += (s, e) => _updateTrigger.IsUpdateRequired = true; 17 | _updateTrigger.UpdateAction = 18 | () => _dataContextService.UpdateDataContext(selectedTreeItemService.SelectedTreeItem); 19 | 20 | _dataContextService = ServiceLocator.Resolve(); 21 | } 22 | 23 | public UpdateTrigger UpdateTrigger { get { return _updateTrigger; } } 24 | 25 | public DataContextInfo DataContextInfo 26 | { 27 | get { return _dataContextService.DataContextInfo; } 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/Converters/BoolToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | using System.Windows; 7 | 8 | namespace ChristianMoser.WpfInspector.UserInterface.Converters 9 | { 10 | public class BoolToVisibilityConverter : ValueConverterBase , IValueConverter 11 | { 12 | public BoolToVisibilityConverter() 13 | { 14 | 15 | } 16 | 17 | #region IValueConverter Members 18 | 19 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | bool invert = false; 22 | 23 | if (parameter is string) 24 | { 25 | bool.TryParse((string)parameter, out invert); 26 | } 27 | 28 | if( value is bool) 29 | { 30 | return ((bool)value) ^ invert ? Visibility.Visible : Visibility.Collapsed; 31 | } 32 | return value; 33 | } 34 | 35 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /source/Inspector/Services/Triggers/DataTriggerItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows; 5 | 6 | namespace ChristianMoser.WpfInspector.Services.Triggers 7 | { 8 | 9 | public class DataTriggerItem : TriggerItemBase 10 | { 11 | #region Private Members 12 | 13 | private readonly DataTrigger _dataTrigger; 14 | private readonly FrameworkElement _source; 15 | 16 | #endregion 17 | 18 | #region Construction 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | public DataTriggerItem(DataTrigger trigger, FrameworkElement source, TriggerSource triggerSource) 24 | : base(source, TriggerType.DataTrigger, triggerSource) 25 | { 26 | _dataTrigger = trigger; 27 | _source = source; 28 | } 29 | 30 | #endregion 31 | 32 | protected override IEnumerable GetSetters() 33 | { 34 | return _dataTrigger.Setters.Select(s => new SetterItem(s, _source)); 35 | } 36 | 37 | protected override IEnumerable GetConditions() 38 | { 39 | yield return new ConditionItem(_dataTrigger.Binding, Instance, _dataTrigger.Value); 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/IssueListView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using ChristianMoser.WpfInspector.Services.Analyzers; 15 | using ChristianMoser.WpfInspector.Services.DataObjects; 16 | 17 | namespace ChristianMoser.WpfInspector.UserInterface 18 | { 19 | /// 20 | /// Interaction logic for IssueListView.xaml 21 | /// 22 | public partial class IssueListView : UserControl 23 | { 24 | private readonly IssuesListViewModel _viewModel; 25 | 26 | public IssueListView() 27 | { 28 | InitializeComponent(); 29 | _viewModel = new IssuesListViewModel(); 30 | DataContext = _viewModel; 31 | } 32 | 33 | private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) 34 | { 35 | if( e.AddedItems != null && e.AddedItems.Count > 0 ) 36 | { 37 | _viewModel.OnIssueSelected(e.AddedItems[0] as Issue); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /source/Inspector/Services/Triggers/TriggerItemFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ChristianMoser.WpfInspector.Services.Triggers 8 | { 9 | public static class TriggerItemFactory 10 | { 11 | public static TriggerItemBase GetTriggerItem(TriggerBase trigger, FrameworkElement source, TriggerSource triggerSource) 12 | { 13 | TriggerItemBase triggerItem; 14 | if (trigger is Trigger) 15 | { 16 | triggerItem = new TriggerItem((Trigger)trigger, source, triggerSource); 17 | } 18 | else if (trigger is DataTrigger) 19 | { 20 | triggerItem = new DataTriggerItem((DataTrigger)trigger, source, triggerSource); 21 | } 22 | else if (trigger is MultiTrigger) 23 | { 24 | triggerItem = new MultiTriggerItem((MultiTrigger)trigger, source, triggerSource); 25 | } 26 | else if (trigger is MultiDataTrigger) 27 | { 28 | triggerItem = new MultiDataTriggerItem((MultiDataTrigger)trigger, source, triggerSource); 29 | } 30 | else 31 | { 32 | return null; 33 | } 34 | triggerItem.Initialize(); 35 | return triggerItem; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/BindingEditorWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using ChristianMoser.WpfInspector.UserInterface.Controls.PropertyItems; 3 | 4 | 5 | namespace ChristianMoser.WpfInspector.UserInterface 6 | { 7 | /// 8 | /// Interaction logic for BindingEditor.xaml 9 | /// 10 | public partial class BindingEditorWindow : Window 11 | { 12 | private readonly BindingEditorViewModel _viewModel; 13 | 14 | #region Construction 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | /// The property item. 20 | public BindingEditorWindow(PropertyItem propertyItem) 21 | { 22 | InitializeComponent(); 23 | _viewModel = new BindingEditorViewModel(propertyItem); 24 | DataContext = _viewModel; 25 | 26 | tree.SelectedItemChanged += (s, e) => _viewModel.SelectedPathItem = (PathItem)tree.SelectedValue; 27 | } 28 | 29 | #endregion 30 | 31 | #region Private Helpers 32 | 33 | private void OkClick(object sender, RoutedEventArgs e) 34 | { 35 | if (_viewModel.ActivateBinding()) 36 | { 37 | DialogResult = true; 38 | Close(); 39 | } 40 | } 41 | 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/StyleExplorerViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using ChristianMoser.WpfInspector.Services; 3 | using ChristianMoser.WpfInspector.Services.StyleExplorer; 4 | using System.Windows.Data; 5 | 6 | namespace ChristianMoser.WpfInspector.UserInterface 7 | { 8 | public class StyleExplorerViewModel : UpdateTriggeredTreeItemViewModel 9 | { 10 | #region Private Members 11 | 12 | private readonly StyleExplorerService _styleExplorerService; 13 | 14 | #endregion 15 | 16 | #region Construction 17 | 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | public StyleExplorerViewModel() 22 | { 23 | _styleExplorerService = ServiceLocator.Resolve(); 24 | 25 | StyleItems = new ListCollectionView(_styleExplorerService.StyleItems); 26 | //StyleItems.GroupDescriptions.Add(new PropertyGroupDescription("Location")); 27 | } 28 | 29 | #endregion 30 | 31 | /// 32 | /// Gets the style items. 33 | /// 34 | public ListCollectionView StyleItems { get; private set; } 35 | 36 | protected override void OnTriggerUpdate() 37 | { 38 | _styleExplorerService.UpdateStyle(SelectedTreeItem); 39 | StyleItems.Refresh(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /source/Inspector/Services/ServiceLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ChristianMoser.WpfInspector.Services 5 | { 6 | public class ServiceLocator 7 | { 8 | private static readonly Dictionary Instances = new Dictionary(); 9 | 10 | public static void RegisterInstance(object instance) 11 | { 12 | var type = typeof(TInterface); 13 | if (!Instances.ContainsKey(type)) 14 | { 15 | Instances.Add(type, instance); 16 | } 17 | else 18 | { 19 | Instances[type] = instance; 20 | } 21 | } 22 | 23 | public static T Resolve() 24 | where T : class, new() 25 | { 26 | var type = typeof(T); 27 | if (!Instances.ContainsKey(type)) 28 | { 29 | var instance = new T(); 30 | Instances.Add(type, instance); 31 | } 32 | return (T)Instances[type]; 33 | } 34 | 35 | public static void ShutDown() 36 | { 37 | foreach (var instance in Instances.Values) 38 | { 39 | var disposable = instance as IDisposable; 40 | if (disposable != null) 41 | { 42 | disposable.Dispose(); 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /source/Hook64_35/Injector.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "hook.h" 3 | #include 4 | 5 | static unsigned int WM_INSPECT = ::RegisterWindowMessage(L"WM_INSPECT"); 6 | static HHOOK _messageHookHandle; 7 | 8 | __declspec( dllexport ) 9 | int __stdcall MessageHookProc(int nCode, WPARAM wparam, LPARAM lparam) { 10 | 11 | if (nCode == HC_ACTION) 12 | { 13 | CWPSTRUCT* msg = (CWPSTRUCT*)lparam; 14 | if (msg != NULL && msg->message == WM_INSPECT) 15 | { 16 | //System::String^ local = System::Runtime::InteropServices::Marshal::PtrToStringUni( msg->wParam); 17 | wchar_t* acmRemote = (wchar_t*)msg->wParam; 18 | //System::String^ acmLocal = System::String::Format("{0}", (System::IntPtr)acmRemote)); 19 | System::String^ acmLocal = gcnew System::String(acmRemote); 20 | cli::array^ acmSplit = acmLocal->Split('$'); 21 | 22 | System::Reflection::Assembly^ assembly = System::Reflection::Assembly::LoadFile(acmSplit[0]); 23 | if (assembly != nullptr) 24 | { 25 | System::Type^ type = assembly->GetType(acmSplit[1]); 26 | if (type != nullptr) 27 | { 28 | System::Reflection::MethodInfo^ methodInfo = type->GetMethod(acmSplit[2], System::Reflection::BindingFlags::Static | System::Reflection::BindingFlags::Public); 29 | if (methodInfo != nullptr) 30 | { 31 | methodInfo->Invoke(nullptr, nullptr); 32 | } 33 | } 34 | } 35 | } 36 | } 37 | return CallNextHookEx(_messageHookHandle, nCode, wparam, lparam); 38 | } -------------------------------------------------------------------------------- /source/Hook64_40/Injector.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "hook.h" 3 | #include 4 | 5 | static unsigned int WM_INSPECT = ::RegisterWindowMessage(L"WM_INSPECT"); 6 | static HHOOK _messageHookHandle; 7 | 8 | __declspec( dllexport ) 9 | int __stdcall MessageHookProc(int nCode, WPARAM wparam, LPARAM lparam) { 10 | 11 | if (nCode == HC_ACTION) 12 | { 13 | CWPSTRUCT* msg = (CWPSTRUCT*)lparam; 14 | if (msg != NULL && msg->message == WM_INSPECT) 15 | { 16 | //System::String^ local = System::Runtime::InteropServices::Marshal::PtrToStringUni( msg->wParam); 17 | wchar_t* acmRemote = (wchar_t*)msg->wParam; 18 | //System::String^ acmLocal = System::String::Format("{0}", (System::IntPtr)acmRemote)); 19 | System::String^ acmLocal = gcnew System::String(acmRemote); 20 | cli::array^ acmSplit = acmLocal->Split('$'); 21 | 22 | System::Reflection::Assembly^ assembly = System::Reflection::Assembly::LoadFile(acmSplit[0]); 23 | if (assembly != nullptr) 24 | { 25 | System::Type^ type = assembly->GetType(acmSplit[1]); 26 | if (type != nullptr) 27 | { 28 | System::Reflection::MethodInfo^ methodInfo = type->GetMethod(acmSplit[2], System::Reflection::BindingFlags::Static | System::Reflection::BindingFlags::Public); 29 | if (methodInfo != nullptr) 30 | { 31 | methodInfo->Invoke(nullptr, nullptr); 32 | } 33 | } 34 | } 35 | } 36 | } 37 | return CallNextHookEx(_messageHookHandle, nCode, wparam, lparam); 38 | } -------------------------------------------------------------------------------- /source/Inspector/Services/Resources/StyleResourceItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ChristianMoser.WpfInspector.Services.Resources 8 | { 9 | public sealed class StyleResourceItem : ResourceItem 10 | { 11 | private readonly object _resourceKey; 12 | private readonly Style _style; 13 | 14 | public StyleResourceItem(object resourceKey, ResourceDictionary dictionary, FrameworkElement source, ResourceScope scope) 15 | : base(resourceKey, dictionary, source, scope) 16 | { 17 | _resourceKey = resourceKey; 18 | _style = Value as Style; 19 | } 20 | 21 | /// 22 | /// Gets the name. 23 | /// 24 | public override string Name 25 | { 26 | get 27 | { 28 | var type = _resourceKey as Type; 29 | if (type != null) 30 | { 31 | return string.Format("{0} (Default)", type.Name); 32 | } 33 | return _resourceKey.ToString(); 34 | } 35 | } 36 | 37 | /// 38 | /// Gets the category. 39 | /// 40 | public override string Category 41 | { 42 | get 43 | { 44 | return "Styles"; 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /source/Inspector/Services/Resizing/SizeItem.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | using System; 3 | using ChristianMoser.WpfInspector.Utilities; 4 | 5 | namespace ChristianMoser.WpfInspector.Services.Resizing 6 | { 7 | public class SizeItem 8 | { 9 | #region Construction 10 | 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | public SizeItem(double width, double height, Action setSizeFunction) 15 | { 16 | Width = width; 17 | Height = height; 18 | SizeCommand = new Command(o => setSizeFunction(Width, Height)); 19 | } 20 | 21 | #endregion 22 | 23 | /// 24 | /// Gets the width. 25 | /// 26 | public double Width { get; private set; } 27 | 28 | /// 29 | /// Gets the height. 30 | /// 31 | public double Height { get; private set; } 32 | 33 | /// 34 | /// Gets the name. 35 | /// 36 | public string Name 37 | { 38 | get 39 | { 40 | return string.Format("{0}x{1}", Width, Height); 41 | } 42 | } 43 | 44 | /// 45 | /// Gets or sets the command to set the size 46 | /// 47 | public ICommand SizeCommand { get; private set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /source/Process32Helper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("32-Bit Process Helper")] 9 | [assembly: AssemblyDescription("Helps to execute work in the 32-bit world")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Christian Moser")] 12 | [assembly: AssemblyProduct("WPF Inspector")] 13 | [assembly: AssemblyCopyright("(c) Copyright by Christian Moser 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bd0746ba-4d2b-4ead-892d-f4a29bd922ee")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /source/Inspector/UserInterface/UsageHintWindow.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |