private void ThisMainWindow_ContentRendered(object sender, EventArgs e) { macrosItemList.ItemsSource = Variables.Macros; if (!IsStartedAsAdmin) { var result = MessageBox.Show("Note: NotEnoughHotkeys was started without Admin permissions. It will only work partially and won't work inside processes with admin privileges. Do you want to restart as Admin? ", "Disclaimer", MessageBoxButton.YesNo, MessageBoxImage.Information); if (result == MessageBoxResult.Yes) { ProcessStartInfo psi = new ProcessStartInfo(Assembly.GetExecutingAssembly().Location); psi.UseShellExecute = true; psi.Verb = "runas"; Process.Start(psi); Environment.Exit(0); } } var Handle = new WindowInteropHelper(this).Handle; rawInput = new RawInput(); rawInput.RawKeyPressEvent += new RawInput.RawInputHandler(RawInputHandler); rawInput.Start(); trayIcon = new TrayIcon(this); settingsWindow = new SettingsWindow(); }
public static void Init(SettingsWindow _w) { w = _w; w.MouseLeftButtonDown += new MouseButtonEventHandler(DragMoveHandler); }