对于自定义的dll,一bai般放在plugins文件夹中
http://blog.csdn.net/ycl295644/article/details/40659189
对于window中中本身dll,可以直接引用,不用把dll放在文件夹中
引用命名空间 using System.Runtime.InteropServices;
[DllImport("User32.dll", EntryPoint = "GetWindowText")]
private static extern int GetWindowText(IntPtr hwnd, StringBuilder text, int MaxLen);
//获得当前激活窗口
[DllImport("user32")]
protected static extern IntPtr GetActiveWindow();
//发送窗口消息
[DllImport("User32.dll", EntryPoint = "SendMessage")]
private static extern int SendMessage(
IntPtr hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
int lParam // second message parameter
);
public struct COPYDATASTRUCT
{
public IntPtr dwData;
public int cData;
[MarshalAs(UnmanagedType.LPStr)]
public string lpData;
}
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hwnd, int msg, int wParam, ref COPYDATASTRUCT IParam);
unity3D使用User32.dll
最新推荐文章于 2024-06-13 16:44:31 发布