+// a wrapper macro for ZeroMemory()
+#ifdef __WIN32__
+#define wxZeroMemory(obj) ::ZeroMemory(&obj, sizeof(obj))
+#else
+#define wxZeroMemory(obj) memset((void*) & obj, 0, sizeof(obj))
+#endif
+
+#include <wx/gdicmn.h>
+
+// 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));
+}
+
+// copy Windows RECT to our wxRect
+inline void wxCopyRECTToRect(const RECT& r, wxRect& rect)
+{
+ rect.y = r.top;
+ rect.x = r.left;
+ rect.width = r.right - r.left;
+ rect.height = r.bottom - r.top;
+}
+
+// translations between HIMETRIC units (which OLE likes) and pixels (which are
+// liked by all the others) - implemented in msw/utilsexc.cpp
+extern void HIMETRICToPixel(LONG *x, LONG *y);
+extern void PixelToHIMETRIC(LONG *x, LONG *y);
+
+// Windows convention of the mask is opposed to the wxWindows one, so we need
+// to invert the mask each time we pass one/get one to/from Windows
+extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w = 0, int h = 0);
+
+// get (x, y) from DWORD - notice that HI/LOWORD can *not* be used because they
+// will fail on system with multiple monitors where the coords may be negative
+//
+// these macros are standard now (Win98) but some older headers don't have them
+#ifndef GET_X_LPARAM
+ #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
+ #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
+#endif // GET_X_LPARAM
+
+// ---------------------------------------------------------------------------
+// small helper classes
+// ---------------------------------------------------------------------------