public Form1() { InitializeComponent(); m_keyboardHookListener = new KeyboardHookListener(gh); m_keyboardHookListener.Enabled = true; m_keyboardHookListener.KeyDown += HookManager_KeyDown; m_keyboardHookListener.KeyUp += HookManager_KeyUp; Bitmap screenSize = (Bitmap)sc.CaptureWholeScreen(); this.Location = new Point(2 * screenSize.Width, 2 * screenSize.Height); worker = new Thread(() => { while (true) { try { //dispose(); update(); } catch (Exception e) { Console.WriteLine(e.StackTrace); } } }); worker.IsBackground = true; worker.Start(); }