如何在我的应用程序打开后立即开始屏幕录制?

问题描述:

我正尝试使用编码器4创建屏幕录制程序。 我希望我的程序在打开窗口后立即开始录制。以下是我迄今为止:如何在我的应用程序打开后立即开始屏幕录制?

但我不断收到一个错误说:没有过载为“App_Activated”匹配委托“System.EventHandler”

感谢所有帮助

<Window x:Class="ScreenCapture.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Screen Capture" 
    Activated="App_Activated" 
    Closing="OnClose" 
    mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    Height="76" Width="99" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"        WindowStyle="ToolWindow"> 


protected void App_Activated(object sender, System.ComponentModel.AddingNewEventArgs e) 
    { 
     System.Drawing.Size monitorSize = SystemInformation.PrimaryMonitorSize; 
     Rectangle capRect = new Rectangle(0, 0, monitorSize.Width, monitorSize.Height); 
     job.CaptureRectangle = capRect; 
     job.OutputPath = @"C:\output\ScreenCap"; 
     job.Start(); 
    } 

。你还没有用正确的签名声明它,它应该是void App_Activated(object sender, EventArgs e)

+0

它不起作用它的说法类型或namepsace EventArgs找不到 – Telenoobies 2012-02-11 20:58:30

+0

其在.NET中的核心类,使用它,你只需要: - 使用系统; – 2012-02-11 22:27:24

+0

或System.EventArgs – 2012-02-11 22:27:50