private void btnActiveWindow_Click(object sender, EventArgs e) { //Minimize application WindowState = FormWindowState.Minimized; try { //get active window UiWindow uiWindow = UiFactory.Instance.NewUiWindow(); uiWindow.FromActiveWindow(); //initialize uiNode from active window uiNode.FromWindow(uiWindow); SetSelector(); } catch (Exception ex) { //restore application WindowState = FormWindowState.Normal; System.Windows.Forms.MessageBox.Show(ex.Message + "\r\nAn error appear while trying to initialize an UiNode from an UiWindow"); } //restore application WindowState = FormWindowState.Normal; }