Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the overlay window not appear in the window list #156

Merged
merged 1 commit into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Carnac.Logic/Win32Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static class Win32Methods
public const int WM_SYSKEYUP = 261;
public const int WM_SYSKEYDOWN = 260;
public const int WS_EX_TRANSPARENT = 0x00000020;
public const int WS_EX_TOOLWINDOW = 0x00000080;
public const int GWL_EXSTYLE = (-20);

//
Expand All @@ -40,10 +41,10 @@ public static class Win32Methods
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);

public static void SetWindowExTransparent(IntPtr hwnd)
public static void SetWindowExTransparentAndNotInWindowList(IntPtr hwnd)
{
var extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW);
}
}
}
5 changes: 2 additions & 3 deletions src/Carnac/UI/KeyShowView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ protected override void OnSourceInitialized(EventArgs e)
base.OnSourceInitialized(e);

var hwnd = new WindowInteropHelper(this).Handle;
Win32Methods.SetWindowExTransparent(hwnd);

Win32Methods.SetWindowExTransparentAndNotInWindowList(hwnd);
var timer = new Timer(100);
timer.Elapsed +=
(s, x) =>
Expand Down Expand Up @@ -83,7 +82,7 @@ public static readonly int

private void WindowLoaded(object sender, RoutedEventArgs e)
{

}

void SettingsLeftChanged(object sender, EventArgs e)
Expand Down