示例#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);
            }
        }
 protected override void OnStart()
 {
     cbHookWindow = new HookWindow("ClipboardManager window");
     cbHookWindow.HandleCreated += CbHookWindow_HandleCreated;
     cbHookWindow.InitWindow();
 }