Created
August 10, 2022 06:33
-
-
Save kant2002/07cf7ec06391e92a0d67409665fc0d14 to your computer and use it in GitHub Desktop.
LibraryImport Generator sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[LibraryImport(Libraries.UxTheme)] | |
public static partial HRESULT DrawThemeEdge( | |
IntPtr hTheme, | |
Gdi32.HDC hdc, | |
int iPartId, | |
int iStateId, | |
ref RECT pDestRect, | |
User32.EDGE uEdge, | |
User32.BF uFlags, | |
ref RECT pContentRect); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static unsafe partial class Interop | |
{ | |
public static unsafe partial class UxTheme | |
{ | |
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "7.0.6.40809")] | |
[System.Runtime.CompilerServices.SkipLocalsInitAttribute] | |
public static partial global::Interop.HRESULT DrawThemeEdge(nint hTheme, global::Interop.Gdi32.HDC hdc, int iPartId, int iStateId, ref global::Interop.RECT pDestRect, global::Interop.User32.EDGE uEdge, global::Interop.User32.BF uFlags, ref global::Interop.RECT pContentRect) | |
{ | |
global::Interop.HRESULT __retVal; | |
// Pin - Pin data in preparation for calling the P/Invoke. | |
fixed (global::Interop.RECT* __pDestRect_native = &pDestRect) | |
fixed (global::Interop.RECT* __pContentRect_native = &pContentRect) | |
{ | |
__retVal = __PInvoke(hTheme, hdc, iPartId, iStateId, __pDestRect_native, uEdge, uFlags, __pContentRect_native); | |
} | |
return __retVal; | |
// Local P/Invoke | |
[System.Runtime.InteropServices.DllImportAttribute("uxtheme.dll", EntryPoint = "DrawThemeEdge", ExactSpelling = true)] | |
static extern unsafe global::Interop.HRESULT __PInvoke(nint hTheme, global::Interop.Gdi32.HDC hdc, int iPartId, int iStateId, global::Interop.RECT* pDestRect, global::Interop.User32.EDGE uEdge, global::Interop.User32.BF uFlags, global::Interop.RECT* pContentRect); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment