From f10d8568cbdbb340befaeaea0b02dd4b0438ec4e Mon Sep 17 00:00:00 2001 From: Fraser Date: Thu, 20 Feb 2014 22:26:53 +0000 Subject: [PATCH] CreateIconIndirect function. --- Source/OpenTK/Platform/Windows/API.cs | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 1012e761..13e48714 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -856,6 +856,37 @@ namespace OpenTK.Platform.Windows #endregion + #region CreateIconIndirect + + /// + /// Creates an icon or cursor from an IconInfo structure. + /// + /// + /// A pointer to an IconInfo structure the function uses to create the + /// icon or cursor. + /// + /// + /// If the function succeeds, the return value is a handle to the icon + /// or cursor that is created. + /// + /// If the function fails, the return value is null. To get extended + /// error information, call Marshal.GetLastWin32Error. + /// + /// + /// The system copies the bitmaps in the IconInfo structure before + /// creating the icon or cursor. Because the system may temporarily + /// select the bitmaps in a device context, the hbmMask and hbmColor + /// members of the IconInfo structure should not already be selected + /// into a device context. The application must continue to manage the + /// original bitmaps and delete them when they are no longer necessary. + /// When you are finished using the icon, destroy it using the + /// DestroyIcon function. + /// + [DllImport("user32.dll", SetLastError=true)] + public static extern HICON CreateIconIndirect(ref IconInfo iconInfo); + + #endregion + [DllImport("user32.dll", SetLastError = true)] public static extern BOOL SetForegroundWindow(HWND hWnd);