/// <summary> /// Create the screen shot request /// </summary> public void DoRequest(bool setInterval = false) { HookManager.ProcessInfo pInfo = AttachCurrentProcess(); if (pInfo == null) { return; } ScreenshotManager_OnScreenshotDebugMessage(pInfo.Process.Id, "Do request " + setInterval); start = DateTime.Now; ScreenshotManager.AddScreenshotRequest(pInfo.Process.Id, new ScreenshotRequest(FileName(pInfo.Process), Properties.Settings.Default.format.ToString(), setInterval, Properties.Settings.Default.interval), Callback); }
/// <summary> /// Запрос на обновление скриншота /// </summary> public void RefreshScreenshot() { if (InRefresh || IsLocked) { return; } inRefresh = true; ScreenshotManager.AddScreenshotRequest( pid, new ScreenshotRequest(new Rectangle(0, 0, 0, 0)), ScreenshotManagerCallback ); }
public void IntervalCapture(object prs) { HookManager.ProcessInfo pInfo = (HookManager.ProcessInfo)prs; Process process = pInfo.Process; while (Thread.CurrentThread == pInfo.IntervalThread && !pInfo.Process.HasExited) { ScreenshotManager.AddScreenshotRequest(process.Id, new ScreenshotRequest(FileName(process), Properties.Settings.Default.format.ToString()), Callback); Thread.Sleep(pInfo.Interval * 1000); } if (Thread.CurrentThread == pInfo.IntervalThread) { pInfo.IntervalThread = null; } }
/// <summary> /// Create the screen shot request /// </summary> void DoRequest() { progressBar1.Invoke(new MethodInvoker(delegate() { if (progressBar1.Value < progressBar1.Maximum) { progressBar1.PerformStep(); // Add a request to the screenshot manager - the ScreenshotInterface will pass this on to the injected assembly ScreenshotManager.AddScreenshotRequest(processId, new ScreenshotRequest(new Rectangle(int.Parse(txtCaptureX.Text), int.Parse(txtCaptureY.Text), int.Parse(txtCaptureWidth.Text), int.Parse(txtCaptureHeight.Text))), Callback); } else { end = DateTime.Now; MessageBox.Show((end - start).ToString()); } }) ); }
/// <summary> /// Create the screen shot request /// </summary> public void DoRequestOld() { HookManager.ProcessInfo pInfo = AttachCurrentProcess(); if (pInfo == null) { return; } ScreenshotManager_OnScreenshotDebugMessage(pInfo.Process.Id, "Do request "); start = DateTime.Now; //int j; //ImageCodecInfo[] encoders; //encoders = ImageCodecInfo.GetImageEncoders(); //for(j = 0; j < encoders.Length; ++j) //{ // ScreenshotManager_OnScreenshotDebugMessage(process.Id, encoders[j].MimeType); //} if (pInfo.IntervalThread == null) { if (Properties.Settings.Default.interval > 0) { pInfo.Interval = Properties.Settings.Default.interval; pInfo.IntervalThread = new Thread(new ParameterizedThreadStart(IntervalCapture)); pInfo.IntervalThread.Start(pInfo); } else { // Add a request to the screenshot manager - the ScreenshotInterface will pass this on to the injected assembly ScreenshotManager.AddScreenshotRequest(pInfo.Process.Id, new ScreenshotRequest(FileName(pInfo.Process), Properties.Settings.Default.format.ToString()), Callback); } } else { pInfo.IntervalThread = null; } }
public void sendRequest(ScreenshotRequest request) { ScreenshotManager.AddScreenshotRequest(hookedProcess.Id, request, notify); }