Skip to content

Commit

Permalink
Update MainWindow.xaml.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHammas committed Jan 7, 2021
1 parent cfa503d commit 5eb3154
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public partial class MainWindow

//Modifiers:
private const uint MOD_NONE = 0x0000; //(none)

private const uint MOD_ALT = 0x0001; //ALT

/*private const uint MOD_CONTROL = 0x0002; //CTRL
private const uint MOD_SHIFT = 0x0004; //SHIFT
private const uint MOD_WIN = 0x0008; //WINDOWS
Expand All @@ -65,6 +67,7 @@ public MainWindow()

private IntPtr _windowHandle;
private HwndSource _source;

protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
Expand All @@ -75,6 +78,7 @@ protected override void OnSourceInitialized(EventArgs e)

RegisterHotKey(_windowHandle, HOTKEY_ID, MOD_ALT, VK_SPACE); //CTRL + CAPS_LOCK
}

private IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
const int WM_HOTKEY = 0x0312;
Expand Down Expand Up @@ -109,6 +113,7 @@ private IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref

return IntPtr.Zero;
}

protected override void OnClosed(EventArgs e)
{
_source.RemoveHook(HwndHook);
Expand All @@ -130,8 +135,10 @@ private async void InitializeAsync()
{
CheckBoxGoogleSearch.IsChecked = false;
CheckBoxGoogleSearch.IsEnabled = false;
CheckBoxGoogleSearch.ToolTip = "Google search not available because you need to install WebWiew2 runtime. Please Install this runtime and check again.";
MessageBox.Show("Google search not available because you need to install 'WebWiew2 runtime'.\nPlease Install this runtime and check again.\n Press Alt+Space to activate Modern Start Menu.");
CheckBoxGoogleSearch.ToolTip =
"Google search not available because you need to install WebWiew2 runtime. Please Install this runtime and check again.";
MessageBox.Show(
"Google search not available because you need to install 'WebWiew2 runtime'.\nPlease Install this runtime and check again.\n Press Alt+Space to activate Modern Start Menu.");
}
}

Expand Down

0 comments on commit 5eb3154

Please sign in to comment.