diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..68214a5 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,22 @@ + on: + push: + branches: + - master + tags: + - '*' + jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + - run: | + dotnet restore + dotnet build + working-directory: src + - uses: actions/upload-artifact@v3 + with: + name: build-artifact + path: src/FlaUInspect/bin \ No newline at end of file diff --git a/.github/workflows/pr-validate.yaml b/.github/workflows/pr-validate.yaml new file mode 100644 index 0000000..2efa2a3 --- /dev/null +++ b/.github/workflows/pr-validate.yaml @@ -0,0 +1,14 @@ + on: + pull_request: + jobs: + pr-validate: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + - run: | + dotnet restore + dotnet build + working-directory: src \ No newline at end of file diff --git a/README.md b/README.md index a8fbee9..350cc57 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # FlaUInspect ![FlaUInspect](/FlaUInspect.png?raw=true) ### Build -| What | Info / Link | -| ---- | ----- | -| *Build* | [![Build status](https://ci.appveyor.com/api/projects/status/q2poa5bpenso8eyv?svg=true)](https://ci.appveyor.com/project/RomanBaeriswyl/flauinspect) | -| *FlaUInspect* | [![FlaUInspect](https://img.shields.io/badge/FlaUInspect-choco-brightgreen.svg)](https://chocolatey.org/packages/flauinspect)
`choco install flauinspect` | -| *CI Artefacts* | [FlauInspect CI](https://ci.appveyor.com/project/RomanBaeriswyl/flauinspect/build/artifacts) | +| What | Info / Link | +|----------------| ----- | +| *Build* | [![Build status](https://ci.appveyor.com/api/projects/status/q2poa5bpenso8eyv?svg=true)](https://ci.appveyor.com/project/RomanBaeriswyl/flauinspect) | +| *FlaUInspect* | [![FlaUInspect](https://img.shields.io/badge/FlaUInspect-choco-brightgreen.svg)](https://chocolatey.org/packages/flauinspect)
`choco install flauinspect` | +| *CI Artifacts* | [FlauInspect CI](https://ci.appveyor.com/project/RomanBaeriswyl/flauinspect/build/artifacts) | ### Installation To install FlaUInspect, either build it yourself, get it from chocolatey (https://community.chocolatey.org/packages/flauinspect) or get the zip from the releases page here on GitHub. diff --git a/src/FlaUInspect/App.config b/src/FlaUInspect/App.config index 8bde09a..cb446fe 100644 --- a/src/FlaUInspect/App.config +++ b/src/FlaUInspect/App.config @@ -1,7 +1,7 @@ - + diff --git a/src/FlaUInspect/Core/HoverMode.cs b/src/FlaUInspect/Core/HoverMode.cs index fcd3e06..bc13ed0 100644 --- a/src/FlaUInspect/Core/HoverMode.cs +++ b/src/FlaUInspect/Core/HoverMode.cs @@ -5,6 +5,8 @@ using FlaUI.Core; using FlaUI.Core.AutomationElements; using FlaUI.Core.Input; +using System.Runtime.InteropServices; +using FlaUInspect.ViewModels; namespace FlaUInspect.Core { @@ -13,15 +15,17 @@ public class HoverMode private readonly AutomationBase _automation; private readonly DispatcherTimer _dispatcherTimer; private AutomationElement _currentHoveredElement; + private MainViewModel _mv; public event Action ElementHovered; - public HoverMode(AutomationBase automation) + public HoverMode(AutomationBase automation, MainViewModel mv) { _automation = automation; _dispatcherTimer = new DispatcherTimer(); _dispatcherTimer.Tick += DispatcherTimerTick; _dispatcherTimer.Interval = TimeSpan.FromMilliseconds(500); + _mv = mv; } public void Start() @@ -38,7 +42,7 @@ public void Stop() private void DispatcherTimerTick(object sender, EventArgs e) { - if (System.Windows.Input.Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control)) + if (System.Windows.Input.Keyboard.Modifiers.HasFlag(System.Windows.Input.ModifierKeys.Control) && System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.LWin)) { var screenPos = Mouse.Position; try @@ -70,6 +74,11 @@ private void DispatcherTimerTick(object sender, EventArgs e) { Console.WriteLine($"Exception: {ex.Message}"); } + catch (COMException cex) + { + _mv.ComExceptionDetected = true; + //MessageBox.Show(cex.Message, "DispatcherTimeTick caught COM exception. Please refresh inspector", MessageBoxButton.OK, MessageBoxImage.Exclamation); + } } } } diff --git a/src/FlaUInspect/FlaUInspect.csproj b/src/FlaUInspect/FlaUInspect.csproj index 26a4194..b2025d4 100644 --- a/src/FlaUInspect/FlaUInspect.csproj +++ b/src/FlaUInspect/FlaUInspect.csproj @@ -9,7 +9,7 @@ Properties FlaUInspect FlaUInspect - v4.7.1 + v4.8.1 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -17,6 +17,21 @@ + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -27,7 +42,7 @@ DEBUG;TRACE prompt 4 - true + false AnyCPU @@ -44,6 +59,7 @@ + @@ -176,13 +192,28 @@ + + 4.0.0 + - 3.2.0 + 4.0.0 - 3.2.0 + 4.0.0 + + + False + Microsoft .NET Framework 4.8.1 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + +