BUG-2043: Fix for a weird combination of windows messages. [skip ci]

This commit is contained in:
Robin 2016-10-18 21:28:57 +02:00
commit 3defd0e6c0

View file

@ -512,18 +512,21 @@ namespace GreenshotPlugin.Controls {
/// <param name="m"></param> /// <param name="m"></param>
/// <returns>true if the message was handled</returns> /// <returns>true if the message was handled</returns>
public static bool HandleMessages(ref Message m) { public static bool HandleMessages(ref Message m) {
if (m.Msg == WM_HOTKEY) { if (m.Msg != WM_HOTKEY)
{
return false;
}
// Call handler // Call handler
if (IsWindows7OrOlder) { if (!IsWindows7OrOlder && !EventDelay.Check())
KeyHandlers[(int)m.WParam](); {
} else {
if (EventDelay.Check()) {
KeyHandlers[(int)m.WParam]();
}
}
return true; return true;
} }
return false; HotKeyHandler handler;
if (KeyHandlers.TryGetValue((int)m.WParam, out handler))
{
handler();
}
return true;
} }
public static string GetKeyName(Keys givenKey) { public static string GetKeyName(Keys givenKey) {