Exemplo n.º 1
0
        internal static void Init(AnonIpcClient client)
        {
            ISLogger.SetLogFileName("InputshareSP_DefaultHost.log");
            ISLogger.Write("Starting SP default host");
            iClient = client;

            outMan = new WindowsOutputManager();
            outMan.Start();

            deskThread = new ActiveDesktopThread();
            deskThread.Invoke(() => { Desktop.SwitchDesktop(Desktop.InputDesktop); });

            outputDeskThread = new ActiveDesktopThread();
            outputDeskThread.Invoke(() => { Desktop.SwitchDesktop(Desktop.InputDesktop); });

            hWindow = new HookWindow("SPDesktopWatcher");
            hWindow.InitWindow();

            hWindow.InstallDesktopMonitor();
            hWindow.DesktopSwitchEvent += HWindow_DesktopSwitchEvent;

            iClient.Disconnected  += IClient_Disconnected;
            iClient.InputReceived += IClient_InputReceived;

            deskThread.Invoke(() => { GetDisplayConfig(); });
            cursorPosUpdateTimer = new Timer((object o) => { CheckCursorPosition(); }, 0, 0, 50);
            displayCheckTimer    = new Timer((object o) => { CheckForDisplayConfigChange(); }, 0, 0, 1500);
            while (true)
            {
                Thread.Sleep(5000);
            }
        }
Exemplo n.º 2
0
 public KeyboardHook()
 {
     _hookWindow             = new HookWindow();
     _hookWindow.KeyPressed += (object sender, KeyPressedEventArgs e) =>
     {
         KeyPressed?.Invoke(this, e);
     };
 }
Exemplo n.º 3
0
 private void hookChar_Button_Click(object sender, RoutedEventArgs e)
 {
     if (apiHook == null)
     {
         HookWindow hookWindow = new HookWindow();
         hookWindow.Show();
         this.IsEnabled = false;
     }
 }
Exemplo n.º 4
0
 public HotkeyHook()
 {
     _window = new HookWindow();
     _window.CreateHandle(new CreateParams());
     _window.KeyPressed += (sender, args) => {
         if (KeyPressed != null) {
             KeyPressed(this, args);
         }
     };
 }
Exemplo n.º 5
0
 public HotkeyHook()
 {
     _window = new HookWindow();
     _window.CreateHandle(new CreateParams());
     _window.KeyPressed += (sender, args) => {
         if (KeyPressed != null)
         {
             KeyPressed(this, args);
         }
     };
 }
        public override void Start()
        {
            if (Running)
            {
                throw new InvalidOperationException("Clipboard manager already running");
            }

            cbHookWindow = new HookWindow("ClipboardManager window");
            cbHookWindow.HandleCreated += CbHookWindow_HandleCreated;
            Running = true;
        }
Exemplo n.º 7
0
        public void HookChar(int procID)
        {
            HookWindow HookWindow = App.Current.Windows[1] as HookWindow;
            EliteAPI   instance;

            try
            {
                instance = new EliteAPI(procID);
                MainWindow.CatchAPIHook(instance);
                HookWindow.Close();
            }
            catch
            {
                System.Windows.MessageBox.Show("Unable to hook character.\nAre you running as administrator?");
            }
        }
Exemplo n.º 8
0
 protected override void OnStart()
 {
     cbHookWindow = new HookWindow("ClipboardManager window");
     cbHookWindow.HandleCreated += CbHookWindow_HandleCreated;
     cbHookWindow.InitWindow();
 }