23 lines
461 B
C#
23 lines
461 B
C#
|
|
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace PrivacyGlass
|
|
{
|
|
public class HotkeyFilter : IMessageFilter
|
|
{
|
|
private readonly Action onHotkey;
|
|
public HotkeyFilter(Action a) => onHotkey = a;
|
|
|
|
public bool PreFilterMessage(ref Message m)
|
|
{
|
|
if (m.Msg == 0x0312) // WM_HOTKEY
|
|
{
|
|
onHotkey();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
}
|