Add project files.
This commit is contained in:
parent
95ce889aca
commit
b258630e07
19 changed files with 1446 additions and 0 deletions
23
PrivacyGlass/HotkeyFilter.cs
Normal file
23
PrivacyGlass/HotkeyFilter.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue