More DPI fixes, now supporting windows with different DPI settings.

This commit is contained in:
Krom, Robertus 2020-02-19 13:51:36 +01:00
parent efb4c997d4
commit d81d0ad4f1
8 changed files with 814 additions and 27 deletions

View file

@ -20,6 +20,7 @@
*/
using System;
using System.Windows.Forms;
using GreenshotPlugin.UnmanagedHelpers.Enums;
namespace Greenshot.Controls {
/// <summary>
@ -53,8 +54,10 @@ namespace Greenshot.Controls {
protected override void WndProc(ref Message m) {
base.WndProc(ref m);
if (_clickThrough && m.Msg == WM_MOUSEACTIVATE && m.Result == (IntPtr)NativeConstants.MA_ACTIVATEANDEAT) {
m.Result = (IntPtr)NativeConstants.MA_ACTIVATE;
var windowsMessage = (WindowsMessages) m.Msg;
if (_clickThrough && windowsMessage == WindowsMessages.WM_MOUSEACTIVATE && m.Result == (IntPtr)NativeConstants.MA_ACTIVATEANDEAT)
{
m.Result = (IntPtr)NativeConstants.MA_ACTIVATE;
}
}
}