-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGestureOverlay.xaml.cs
More file actions
40 lines (32 loc) · 1.19 KB
/
Copy pathGestureOverlay.xaml.cs
File metadata and controls
40 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
namespace TouchGamingMouse
{
/// <summary>
/// Interaction logic for GestureOverlay.xaml
/// </summary>
public partial class GestureOverlay : Window
{
//TODO: make a base class for this logic
public GestureOverlay()
{
InitializeComponent();
}
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
var helper = new WindowInteropHelper(this);
uint origStyle = WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW; //no taskbar icon or anything
SetWindowLong(helper.Handle, GWL_EXSTYLE, origStyle);
}
private const int GWL_EXSTYLE = -20;
private const int WS_EX_TOOLWINDOW = 0x00000080;
private const int WS_EX_TRANSPARENT = 0x00000020;
[DllImport("user32.dll")]
public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong);
[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
}
}