#include <windows.h>
+// undefine conflicting symbols which were defined in windows.h
+#include "wx/msw/winundef.h"
+
class WXDLLEXPORT wxFont;
+// ---------------------------------------------------------------------------
+// private constants
+// ---------------------------------------------------------------------------
+
+// Conversion
+static const double METRIC_CONVERSION_CONSTANT = 0.0393700787;
+
+// Scaling factors for various unit conversions
+static const double mm2inches = (METRIC_CONVERSION_CONSTANT);
+static const double inches2mm = (1/METRIC_CONVERSION_CONSTANT);
+
+static const double mm2twips = (METRIC_CONVERSION_CONSTANT*1440);
+static const double twips2mm = (1/(METRIC_CONVERSION_CONSTANT*1440));
+
+static const double mm2pt = (METRIC_CONVERSION_CONSTANT*72);
+static const double pt2mm = (1/(METRIC_CONVERSION_CONSTANT*72));
+
// ---------------------------------------------------------------------------
// standard icons from the resources
// ---------------------------------------------------------------------------
// this defines a CASTWNDPROC macro which casts a pointer to the type of a
// window proc
// ---------------------------------------------------------------------------
-#ifdef __GNUWIN32__
+
+#if defined(__GNUWIN32__) && !defined(__MINGW32__)
# define CASTWNDPROC (long unsigned)
#else
# ifdef __BORLANDC__
#endif // USE_DBWIN32
// ---------------------------------------------------------------------------
-// macros to make casting between WXFOO and FOO a bit easier
+// macros to make casting between WXFOO and FOO a bit easier: the GetFoo()
+// returns Foo cast to the Windows type for oruselves, while GetFoosFoo() takes
+// an argument which should be a pointer to wxFoo (is this really clear?)
// ---------------------------------------------------------------------------
#define GetHwnd() ((HWND)GetHWND())
#define GetHdc() ((HDC)GetHDC())
+#define GetHicon() ((HICON)GetHICON())
+#define GetIconHicon(icon) ((HICON)(icon).GetHICON())
+
#define GetHaccel() ((HACCEL)GetHACCEL())
-#define GetTableHaccel(table) ((HACCEL)((table)->GetHACCEL()))
+#define GetTableHaccel(table) ((HACCEL)((table).GetHACCEL()))
// ---------------------------------------------------------------------------
// global data
// get the window class name
WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
-// get the window id
-WXDLLEXPORT extern wxWindowID wxGetWindowId(WXHWND hWnd);
+// get the window id (should be unsigned, hence this is not wxWindowID which
+// is, for mainly historical reasons, signed)
+WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);
// Does this window style specify any border?
inline bool wxStyleHasBorder(long style)