+// make conversion from wxColour and COLORREF a bit less painful
+inline COLORREF wxColourToRGB(const wxColour& c)
+{
+ return RGB(c.Red(), c.Green(), c.Blue());
+}
+
+inline void wxRGBToColour(wxColour& c, COLORREF rgb)
+{
+ c.Set(GetRValue(rgb), GetGValue(rgb), GetBValue(rgb));
+}
+
+// ---------------------------------------------------------------------------
+// small helper classes
+// ---------------------------------------------------------------------------
+
+// create an instance of this class and use it as the HDC for screen, will
+// automatically release the DC going out of scope
+class ScreenHDC
+{
+public:
+ ScreenHDC() { m_hdc = GetDC(NULL); }
+ ~ScreenHDC() { ReleaseDC(NULL, m_hdc); }
+ operator HDC() const { return m_hdc; }
+
+private:
+ HDC m_hdc;
+};