private void updateProcess(ITeamViewer tv, Process p) { if (tv.MainHandle != p.MainWindowHandle) { tv.updateProcess(p); } }
/// <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; } } }
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 } ) ); } }
public IterResult(ITeamViewer tv, IntPtr hWnd) { teamViewer = tv; this.hWnd = hWnd; }
public TeamViewerEventArgs(ITeamViewer tv) { TeamViewer = tv; }