Skip to content

Instantly share code, notes, and snippets.

@kevinw
Created November 20, 2008 15:18
Show Gist options
  • Save kevinw/27062 to your computer and use it in GitHub Desktop.
Save kevinw/27062 to your computer and use it in GitHub Desktop.
class ScreenHDC
{
public:
ScreenHDC() { m_hdc = ::GetDC(NULL); }
~ScreenHDC() { ::ReleaseDC(NULL, m_hdc); }
operator HDC() const { return m_hdc; }
private:
HDC m_hdc;
DECLARE_NO_COPY_CLASS(ScreenHDC)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment