Example #1
0
        /// <summary>
        /// Update position of screen to x1(0), y1(0)
        /// </summary>
        public void zeroPosition()
        {
            foreach (var tvs in data.TeamViewers)
            {
                ITeamViewer   tv = tvs.Value;
                THandleResult h  = tv.handleBy(TVControls.MainScreen.NAME, TVControls.MainScreen.CID);
                if (!h.Found)
                {
                    continue;
                }
                log.debug($"zeroPosition: found handle - {h.HWnd}");

                NativeMethods.RECT r;

                if (!NativeMethods.GetClientRect(h.HWnd, out r))
                {
                    log.info($"GetClientRect [Error: {Marshal.GetLastWin32Error()}]");
                    continue;
                }

                // Fix Top 1 -> 0
                if (!NativeMethods.MoveWindow(h.HWnd, 0, 0, r.right + r.left, r.bottom + r.top, true))
                {
                    log.info($"MoveWindow [Error: {Marshal.GetLastWin32Error()}]");
                    continue;
                }
            }
        }
Example #2
0
 /// <summary>
 /// Switching of the fullscreen mode.
 /// </summary>
 public void fullscreen()
 {
     foreach (IterResult t in Toolbars)
     {
         THandleResult h = t.teamViewer.handleByCID(TVControls.ToolBar.FULLSCR_CID);
         if (h.Found)
         {
             log.debug($"fullscreen: found handle - {h.HWnd}");
             t.teamViewer.sendClickFor(h.HWnd);
         }
     }
 }
Example #3
0
 /// <summary>
 /// To minimize/maximize the top toolbar.
 /// </summary>
 public void minimizePanel()
 {
     foreach (IterResult t in Toolbars)
     {
         THandleResult h = t.teamViewer.handleByCID(TVControls.ToolBar.MINIMIZE_CID);
         if (h.Found)
         {
             log.debug($"minimizePanel: found handle - {h.HWnd}");
             t.teamViewer.sendClickFor(h.HWnd);
         }
     }
 }
Example #4
0
        /// <summary>
        /// To show/hide the top toolbar.
        /// </summary>
        /// <param name="status"></param>
        public void showPanel(bool status)
        {
            foreach (IterResult t in Toolbars)
            {
                log.debug($"showPanel({status}): found handle - {t.hWnd}");
                t.teamViewer.showControl(t.hWnd, status);

                // to redraw controls
                THandleResult hScr = t.teamViewer.handleBy(TVControls.MainScreen.NAME, TVControls.MainScreen.CID);
                if (hScr.Found)
                {
                    refresh(status ? t.hWnd : hScr.HWnd);
                }
            }
        }