c#编程问题
来源:百度知道 编辑:UC知道 时间:2024/05/09 09:06:06
这里是一个用API的例子
using System ;
using System.Drawing ;
using System.Collections ;
using System.ComponentModel ;
using System.Windows.Forms ;
using System.Data ;
using System.Drawing.Imaging ;
using System.IO ;
//导入在程序中使用到的名称空间
public class Capture : Form
{
private System.ComponentModel.Container components = null ;
private Icon mNetTrayIcon = new Icon ( "Tray.ico" ) ;
private Bitmap MyImage = null ;
private NotifyIcon TrayIcon ;
private ContextMenu notifyiconMnu ;
public Capture ( )
{
//初始化窗体中使用到的组件
InitializeComponent ( ) ;
}
protected override void OnActivated ( EventArgs e )
{
this.Hide ( ) ;
}
[ System.Runtime.InteropServices.DllImportAttribute ( "gdi32.dll" ) ]
private static extern bool BitBlt (
IntPtr hdcDest , //目标设备的句柄
int nXDest , /