引入using System.Runtime.InteropServices;
引入api函数的格式(以引入 FindWindow为例,使用和成员函数一样使用)
[DllImport("user32.dll", EntryPoint = "FindWindow")]
public static extern int FindWindow(
string lpClassName,
string lpWindowName
);
具体api函数列表 你可以找一个win32api的chm查看
类似这样
[System.Runtime.InteropServices.DllImport("win32.dll")]
问题太笼统,请补充说明