public partial class Form1 : Form
{
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
//[DllImport("User32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Unicode)]
//private static extern int SendMessage(IntPtr hwnd, uint wMsg, int wParam, int lParam);
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
private static extern int SendMessage(IntPtr hwnd, uint wMsg, IntPtr wParam, string lParam);
[DllImport("User32.dll ")]
public static extern IntPtr FindWindowEx(IntPtr parent, IntPtr childe, string strclass, string FrmText);
[DllImport("user32.dll", EntryPoint = "GetDesktopWindow", CharSet = CharSet.Auto, SetLastError = true)]
static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll", SetLastError = true)]
static
c#调用winapi为外部程序控件赋值
最新推荐文章于 2021-08-02 21:37:49 发布