RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.58k stars 236 forks source link

Screen capture Exception #102

Closed ghost closed 7 years ago

ghost commented 7 years ago

I get an error at the end of capture delay. There's an error message about can't load shcore.dll. It's not on my computer.

1/5/2017 4:12:24 PM - Last Resort Handler Markdown Monster v1.1.6 6.1.7601.23569.amd64fre.win7sp1_ldr.161007-0600 - en-US - 32 bit

MarkdownMonster at MarkdownMonster.Windows.WindowUtilities.GetDpiForMonitor(IntPtr hmonitor, DpiType dpiType, UInt32& dpiX, UInt32& dpiY) at MarkdownMonster.Windows.WindowUtilities.GetDpi(IntPtr hwnd, DpiType dpiType) at MarkdownMonster.Windows.WindowUtilities.GetDpiRatio(IntPtr hwnd) at SnagItAddin.ScreenOverlayDesktop.SetDesktop(Boolean includeCursor) at SnagItAddin.ScreenCaptureForm.StartCapture() at SnagItAddin.ScreenCaptureForm.ButtonCapture_Click(Object sender, EventArgs e) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

RickStrahl commented 7 years ago

Thanks for the report. This is on Windows 7?

Looks like you nailed the issue: http://stackoverflow.com/questions/37058349/shcore-dll-on-windows-7-does-it-exist

I can perhaps work around that not adjusting DPI on Win7. This may have other undesirable sideeffects on scaled displays but that might be better than a crash every time :-) Taking a look.

ghost commented 7 years ago

Yes it's Windows 7 on my work computer. It's not a critical thing. I was just checking out the capture feature. I use another screen capture tool and I can copy from there if I need to.

RickStrahl commented 7 years ago

Fixed in 1.1.5 and later.

WIndows 7 falls back to single monitor DPI discovery through GDI+.