that is probably only way to call APIs directly, try to write a separate class which includes all the relevant APIs,seehttp://pinvoke.net/or write some COM object which encapsulates these APIs you need, and use RCW to call them
调试欢乐多
public static extern int Rectangle (
int hdc,
int X1,
int Y1,
int X2,
int Y2
);先在类里定义,像这样,然后在函数可以调用了。
介绍一个很好用的工具,定义都写好的,只要CV一下就可以。api精灵FOR C# 2.35,搜索google就有
都是已经做好的
其实,和C#一样
先做一个类库工程,在里面声明常用的一些api函数,就象这样
[DllImport("gdi32.dll", EntryPoint="Rectangle")]
public static extern int Rectangle (
int hdc,
int X1,
int Y1,
int X2,
int Y2
);
然后在需要时调用这个.dll文件就可以了
实在要用的话,再申明一下,也不会花太多时间。