I want to call an external function like this.
[DllImport("user32.dll")]
static extern IntPtr WindowFromPoint(POINT Point);
However I want to change function name from WindowFromPoint to MyFunc.
So in my managed code I would be able to do :
MyFunc(new POINT());
Because this is not the only function and there is over 100 functions I'm looking for a easy one line solution.
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "WindowFromPoint")]
static extern IntPtr MyFunc(POINT Point);
I believe this will work.
Or, if, for whatever reason, you need to keep the name you can try this:
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
public static IntPtr MyFunc(POINT Point)
{
return WindowFromPoint(Point);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With