From b005b6e542717256609171e7f8ca88d919533b52 Mon Sep 17 00:00:00 2001 From: Fraser Date: Fri, 21 Feb 2014 00:10:57 +0000 Subject: [PATCH] DestroyIcon function. --- Source/OpenTK/Platform/Windows/API.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 5ab400b..454d2aa 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -914,6 +914,40 @@ namespace OpenTK.Platform.Windows #endregion + #region DestroyIcon + + /// + /// Destroys an icon and frees any memory the icon occupied. + /// + /// + /// A handle to the icon to be destroyed. The icon must not be in use. + /// + /// + /// If the function succeeds, the return value is nonzero. + /// + /// If the function fails, the return value is zero. To get extended + /// error information, call Marshal.GetLastWin32Error. + /// + /// + /// It is only necessary to call DestroyIcon for icons and cursors + /// created with the following functions: CreateIconFromResourceEx + /// (if called without the LR_SHARED flag), CreateIconIndirect, and + /// CopyIcon. Do not use this function to destroy a shared icon. A + /// shared icon is valid as long as the module from which it was loaded + /// remains in memory. The following functions obtain a shared icon. + /// + /// LoadIcon + /// LoadImage (if you use the LR_SHARED flag) + /// CopyImage (if you use the LR_COPYRETURNORG flag and the hImage parameter is a shared icon) + /// CreateIconFromResource + /// CreateIconFromResourceEx (if you use the LR_SHARED flag) + /// + [DllImport("user32.dll", SetLastError = true)] + public static extern BOOL DestroyIcon(HICON hIcon); + + #endregion + + [DllImport("user32.dll", SetLastError = true)] public static extern BOOL SetForegroundWindow(HWND hWnd); -- 2.7.4