C#呼叫C++編寫的DLL函式各種引數傳遞問題
阿新 • • 發佈:2018-12-11
- [System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
- [DllImport("User32.dll", CharSet=CharSet.Auto)]
- public static extern bool ScreenToClient(IntPtr hWnd, ref System.Drawing.Point rect);
- [System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
- [DllImport("User32.dll", CharSet=CharSet.Auto)]
- public static extern bool GetWindowRect(IntPtr hWnd, out System.Drawing.Rectangle rect);
- [System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
- [DllImport("User32.dll", CharSet=CharSet.Auto)]
- public static extern bool UnregisterClass([MarshalAs(UnmanagedType.LPTStr)] string className, IntPtr instanceHandle);