private void updateProcess(ITeamViewer tv, Process p)
 {
     if (tv.MainHandle != p.MainWindowHandle)
     {
         tv.updateProcess(p);
     }
 }
Esempio n. 2
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;
                }
            }
        }
Esempio n. 3
0
        private void onTvUpdated(object sender, EventArgs e)
        {
            var collection = ((ITeamViewerCollection)sender).TeamViewers;

            uiAction(() => menuTeamViewers.Enabled = (collection.Count > 0));
            uiAction(() => menuTeamViewers.DropDownItems.Clear());

            foreach (var tvs in collection)
            {
                ITeamViewer tv = tvs.Value;
                uiAction(() =>
                         menuTeamViewers.DropDownItems.Add(
                             new ToolStripMenuItem($"PID: {tv.MainProcess.Id} :: {tv.ExecutablePath}")
                {
                    ToolTipText = tv.CommandLine
                }
                             )
                         );
            }
        }
Esempio n. 4
0
 public IterResult(ITeamViewer tv, IntPtr hWnd)
 {
     teamViewer = tv;
     this.hWnd  = hWnd;
 }
Esempio n. 5
0
 public TeamViewerEventArgs(ITeamViewer tv)
 {
     TeamViewer = tv;
 }