public MainViewer() { InitializeComponent(); FormClosing += MainViewer_FormClosing; FormClosed += MainViewer_FormClosed; _InputListener = new InputListener(viewPort1.Handle); _InputListener.InputKeyEvent = KeyEvent; _InputListener.InputMouseEvent = MouseEvent; DragDrop += new DragEventHandler(Form1_DragDrop); DragEnter += new DragEventHandler(Form1_DragEnter); Application.AddMessageFilter(_InputListener); viewPort1.OnDraw_CB = Draw; //Must keep references OnConnect_CallBack = OnConnect; OnDisconnect_CallBack = OnDisconnect; OnCursorChanged_CallBack = OnCursorChanged; OnDisplayChanged_CallBack = OnDisplayChanged; OnConnectingAttempt_CallBack = OnConnectingAttempt; OnElevateFailed_CallBack = OnElevateFailed; OnElevateSuccess_CallBack = OnElevateSuccess; _Client = Create_Client(viewPort1.Handle, OnConnect_CallBack, OnDisconnect_CallBack, OnCursorChanged_CallBack, OnDisplayChanged_CallBack, OnConnectingAttempt_CallBack); SetOnElevateFailed(_Client, OnElevateFailed_CallBack); SetOnElevateSuccess(_Client, OnElevateSuccess_CallBack); button3.MouseEnter += button_MouseEnter; button3.MouseLeave += button_MouseLeave; button2.MouseEnter += button_MouseEnter; button2.MouseLeave += button_MouseLeave; button4.MouseEnter += button_MouseEnter; button4.MouseLeave += button_MouseLeave; for (var i = 0; i < _Displays.Length; i++) { _Displays[i] = new Rectangle(0, 0, 0, 0); } }
static extern IntPtr Create_Client(IntPtr hwnd, _EmptyFunction onconnect, _EmptyFunction ondisconnect, _OnCursorChanged oncursorchange, _OnDisplayChanged ondisplaychanged, _OnConnectingAttempt onconnectingattempt);
public MainViewer() { InitializeComponent(); FormClosing += MainViewer_FormClosing; FormClosed += MainViewer_FormClosed; _InputListener = new InputListener(viewPort1.Handle); _InputListener.InputKeyEvent = KeyEvent; _InputListener.InputMouseEvent = MouseEvent; DragDrop += new DragEventHandler(Form1_DragDrop); DragEnter += new DragEventHandler(Form1_DragEnter); Application.AddMessageFilter(_InputListener); viewPort1.OnDraw_CB = Draw; //Must keep references OnConnect_CallBack = OnConnect; OnDisconnect_CallBack = OnDisconnect; OnCursorChanged_CallBack = OnCursorChanged; OnDisplayChanged_CallBack = OnDisplayChanged; OnConnectingAttempt_CallBack = OnConnectingAttempt; OnElevateFailed_CallBack = OnElevateFailed; OnElevateSuccess_CallBack = OnElevateSuccess; _Client = Create_Client(viewPort1.Handle, OnConnect_CallBack, OnDisconnect_CallBack, OnCursorChanged_CallBack, OnDisplayChanged_CallBack, OnConnectingAttempt_CallBack); SetOnElevateFailed(_Client, OnElevateFailed_CallBack); SetOnElevateSuccess(_Client, OnElevateSuccess_CallBack); button3.MouseEnter += button_MouseEnter; button3.MouseLeave += button_MouseLeave; button2.MouseEnter += button_MouseEnter; button2.MouseLeave += button_MouseLeave; button4.MouseEnter += button_MouseEnter; button4.MouseLeave += button_MouseLeave; for(var i = 0; i < _Displays.Length; i++) _Displays[i] = new Rectangle(0, 0, 0, 0); }