C#调用WIN API

//1.声明API函数所在的DLL 及函数与参数。
[DllImport("user32.dll", EntryPoint = "GetWindow", SetLastError = true,
CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
//2.声明API函数一个空方法,在以后的使用中就可以直接调用了。

public static extern int GetWindow(int hwnd, int wCmd);

原文地址:https://www.cnblogs.com/fanghui/p/2772975.html