diff --git a/include/WinStd/GDI.h b/include/WinStd/GDI.h index e8c1effa..9bf3bd4e 100644 --- a/include/WinStd/GDI.h +++ b/include/WinStd/GDI.h @@ -46,6 +46,37 @@ namespace winstd } }; + /// + /// Windows HICON wrapper class + /// + class icon : public handle + { + WINSTD_HANDLE_IMPL(icon, NULL) + + public: + /// + /// Closes an open object handle. + /// + /// \sa [DestroyIcon function](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroyicon) + /// + virtual ~icon() + { + if (m_h != invalid) + free_internal(); + } + + protected: + /// + /// Closes an open object handle. + /// + /// \sa [DestroyIcon function](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroyicon) + /// + void free_internal() noexcept override + { + DestroyIcon(m_h); + } + }; + /// /// Device context wrapper class ///