a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/configure wxWidgets-2.8.12.patched/configure
a807a11
--- wxWidgets-2.8.12/configure	2011-03-22 19:59:37 +0800
a807a11
+++ wxWidgets-2.8.12.patched/configure	2011-04-07 11:33:02 +0800
a807a11
@@ -27805,10 +27805,10 @@
a807a11
 
a807a11
             case "${host}" in
a807a11
 	x86_64-*-mingw32* )
a807a11
-                        LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lwctl3d32 -ladvapi32 -lwsock32 -lgdi32"
a807a11
+                        LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lws2_32 -lgdi32"
a807a11
         ;;
a807a11
         * )
a807a11
-            LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32"
a807a11
+            LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lws2_32 -lgdi32"
a807a11
         ;;
a807a11
     esac
a807a11
     if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/include/wx/msw/menuitem.h wxWidgets-2.8.12.patched/include/wx/msw/menuitem.h
a807a11
--- wxWidgets-2.8.12/include/wx/msw/menuitem.h	2011-03-22 20:00:56 +0800
a807a11
+++ wxWidgets-2.8.12.patched/include/wx/msw/menuitem.h	2011-04-07 12:35:30 +0800
a807a11
@@ -54,7 +54,7 @@
a807a11
     // the id for a popup menu is really its menu handle (as required by
a807a11
     // ::AppendMenu() API), so this function will return either the id or the
a807a11
     // menu handle depending on what we're
a807a11
-    int GetRealId() const;
a807a11
+    WXWPARAM GetRealId() const;
a807a11
 
a807a11
     // mark item as belonging to the given radio group
a807a11
     void SetAsRadioGroupStart();
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/aui/framemanager.cpp wxWidgets-2.8.12.patched/src/aui/framemanager.cpp
a807a11
--- wxWidgets-2.8.12/src/aui/framemanager.cpp	2011-03-22 19:59:45 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/aui/framemanager.cpp	2011-04-07 11:43:23 +0800
a807a11
@@ -974,7 +974,7 @@
a807a11
     if (pinfo.name.empty() || already_exists)
a807a11
     {
a807a11
         pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
a807a11
-             ((unsigned long)pinfo.window) & 0xffffffff,
a807a11
+             ((unsigned long)(intptr_t)pinfo.window) & 0xffffffff,
a807a11
              (unsigned int)time(NULL),
a807a11
 #ifdef __WXWINCE__
a807a11
              (unsigned int)GetTickCount(),
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/common/debugrpt.cpp wxWidgets-2.8.12.patched/src/common/debugrpt.cpp
a807a11
--- wxWidgets-2.8.12/src/common/debugrpt.cpp	2011-03-22 19:59:40 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/common/debugrpt.cpp	2011-04-07 11:43:57 +0800
a807a11
@@ -54,6 +54,8 @@
a807a11
     #include "wx/zipstrm.h"
a807a11
 #endif // wxUSE_ZIPSTREAM
a807a11
 
a807a11
+#include <direct.h>
a807a11
+
a807a11
 WX_CHECK_BUILD_OPTIONS("wxQA")
a807a11
 
a807a11
 // ----------------------------------------------------------------------------
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/common/filefn.cpp wxWidgets-2.8.12.patched/src/common/filefn.cpp
a807a11
--- wxWidgets-2.8.12/src/common/filefn.cpp	2011-03-22 19:59:41 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/common/filefn.cpp	2011-04-07 11:44:23 +0800
a807a11
@@ -70,6 +70,8 @@
a807a11
         #endif
a807a11
     #endif // __GNUWIN32__
a807a11
 
a807a11
+    #include <direct.h>
a807a11
+
a807a11
     // io.h is needed for _get_osfhandle()
a807a11
     // Already included by filefn.h for many Windows compilers
a807a11
     #if defined __MWERKS__ || defined __CYGWIN__
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/common/utilscmn.cpp wxWidgets-2.8.12.patched/src/common/utilscmn.cpp
a807a11
--- wxWidgets-2.8.12/src/common/utilscmn.cpp	2011-03-22 19:59:42 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/common/utilscmn.cpp	2011-04-07 13:34:01 +0800
a807a11
@@ -822,7 +822,7 @@
a807a11
     //hInstApp member is only valid if the function fails, in which case it
a807a11
     //receives one of the following error values, which are less than or
a807a11
     //equal to 32.
a807a11
-    const int nResult = (int) sei.hInstApp;
a807a11
+    const intptr_t nResult = (intptr_t)sei.hInstApp;
a807a11
 
a807a11
     // Firefox returns file not found for some reason, so make an exception
a807a11
     // for it
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/dcprint.cpp wxWidgets-2.8.12.patched/src/msw/dcprint.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/dcprint.cpp	2011-03-22 20:00:53 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/dcprint.cpp	2011-04-07 12:01:29 +0800
a807a11
@@ -319,7 +319,7 @@
a807a11
     }
a807a11
 
a807a11
 
a807a11
-    HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
a807a11
+    HGLOBAL hDevMode = (HGLOBAL) data->GetDevMode();
a807a11
 
a807a11
     DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
a807a11
 
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/frame.cpp wxWidgets-2.8.12.patched/src/msw/frame.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/frame.cpp	2011-03-22 20:00:53 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/frame.cpp	2011-04-07 12:11:13 +0800
a807a11
@@ -855,7 +855,7 @@
a807a11
             HDC hdc = ::BeginPaint(GetHwnd(), &ps);
a807a11
 
a807a11
             // Erase background before painting or we get white background
a807a11
-            MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
a807a11
+            MSWDefWindowProc(WM_ICONERASEBKGND, (intptr_t)ps.hdc, 0L);
a807a11
 
a807a11
             if ( hIcon )
a807a11
             {
a807a11
@@ -1085,7 +1085,7 @@
a807a11
                 const wxIcon& icon = GetIcon();
a807a11
                 HICON hIcon = icon.Ok() ? GetHiconOf(icon)
a807a11
                                         : (HICON)GetDefaultIcon();
a807a11
-                rc = (long)hIcon;
a807a11
+                rc = (intptr_t)hIcon; // WXLRESULT is int64 in win64
a807a11
                 processed = rc != 0;
a807a11
             }
a807a11
             break;
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/helpwin.cpp wxWidgets-2.8.12.patched/src/msw/helpwin.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/helpwin.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/helpwin.cpp	2011-04-07 12:15:22 +0800
a807a11
@@ -98,7 +98,7 @@
a807a11
 
a807a11
     wxString str = GetValidFilename(m_helpFile);
a807a11
 
a807a11
-    return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
a807a11
+    return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (intptr_t)(const wxChar*) k) != 0);
a807a11
 }
a807a11
 
a807a11
 // Can't close the help window explicitly in WinHelp
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/mdi.cpp wxWidgets-2.8.12.patched/src/msw/mdi.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/mdi.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/mdi.cpp	2011-04-07 12:22:05 +0800
a807a11
@@ -763,7 +763,7 @@
a807a11
   wxWindowCreationHook hook(this);
a807a11
 
a807a11
   m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
a807a11
-                                 WM_MDICREATE, 0, (LONG)(LPSTR)&mcs;;
a807a11
+                                 WM_MDICREATE, 0, (intptr_t)&mcs;;
a807a11
 
a807a11
   if ( !m_hWnd )
a807a11
   {
a807a11
@@ -1433,14 +1433,14 @@
a807a11
             {
a807a11
                 success = true;
a807a11
                 ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
a807a11
-                             (UINT)subMenu, _("&Window"));
a807a11
+                             (intptr_t)subMenu, _("&Window"));
a807a11
                 break;
a807a11
             }
a807a11
         }
a807a11
 
a807a11
         if ( !success )
a807a11
         {
a807a11
-            ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window"));
a807a11
+            ::AppendMenu(hmenu, MF_POPUP, (intptr_t)subMenu, _("&Window"));
a807a11
         }
a807a11
     }
a807a11
 
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/menu.cpp wxWidgets-2.8.12.patched/src/msw/menu.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/menu.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/menu.cpp	2011-04-07 13:37:06 +0800
a807a11
@@ -370,19 +370,19 @@
a807a11
 
a807a11
     // id is the numeric id for normal menu items and HMENU for submenus as
a807a11
     // required by ::AppendMenu() API
a807a11
-    UINT id;
a807a11
+    UINT_PTR id;
a807a11
     wxMenu *submenu = pItem->GetSubMenu();
a807a11
     if ( submenu != NULL ) {
a807a11
         wxASSERT_MSG( submenu->GetHMenu(), wxT("invalid submenu") );
a807a11
 
a807a11
         submenu->SetParent(this);
a807a11
 
a807a11
-        id = (UINT)submenu->GetHMenu();
a807a11
+        id = (intptr_t)submenu->GetHMenu();
a807a11
 
a807a11
         flags |= MF_POPUP;
a807a11
     }
a807a11
     else {
a807a11
-        id = pItem->GetId();
a807a11
+        id = pItem->GetRealId();
a807a11
     }
a807a11
 
a807a11
 
a807a11
@@ -963,7 +963,7 @@
a807a11
         for ( i = 0, it = m_menus.begin(); i < count; i++, it++ )
a807a11
         {
a807a11
             if ( !::AppendMenu((HMENU)m_hMenu, MF_POPUP | MF_STRING,
a807a11
-                               (UINT)(*it)->GetHMenu(),
a807a11
+                               (intptr_t)(*it)->GetHMenu(),
a807a11
                                m_titles[i]) )
a807a11
             {
a807a11
                 wxLogLastError(wxT("AppendMenu"));
a807a11
@@ -1035,7 +1035,7 @@
a807a11
 
a807a11
     int mswpos = MSWPositionForWxMenu(GetMenu(pos),pos);
a807a11
 
a807a11
-    UINT id;
a807a11
+    UINT_PTR id;
a807a11
     UINT flagsOld = ::GetMenuState((HMENU)m_hMenu, mswpos, MF_BYPOSITION);
a807a11
     if ( flagsOld == 0xFFFFFFFF )
a807a11
     {
a807a11
@@ -1048,7 +1048,7 @@
a807a11
     {
a807a11
         // HIBYTE contains the number of items in the submenu in this case
a807a11
         flagsOld &= 0xff;
a807a11
-        id = (UINT)::GetSubMenu((HMENU)m_hMenu, mswpos);
a807a11
+        id = (intptr_t)::GetSubMenu((HMENU)m_hMenu, mswpos);
a807a11
     }
a807a11
     else
a807a11
     {
a807a11
@@ -1124,7 +1124,7 @@
a807a11
 
a807a11
         if ( !::InsertMenu(GetHmenu(), (UINT)mswpos,
a807a11
                            MF_BYPOSITION | MF_POPUP | MF_STRING,
a807a11
-                           (UINT)GetHmenuOf(menu), title) )
a807a11
+                           (intptr_t)GetHmenuOf(menu), title) )
a807a11
         {
a807a11
             wxLogLastError(wxT("InsertMenu"));
a807a11
         }
a807a11
@@ -1191,7 +1191,7 @@
a807a11
 #else
a807a11
         if ( !::InsertMenu(GetHmenu(), mswpos,
a807a11
                            MF_BYPOSITION | MF_POPUP | MF_STRING,
a807a11
-                           (UINT)GetHmenuOf(menu), title) )
a807a11
+                           (intptr_t)GetHmenuOf(menu), title) )
a807a11
         {
a807a11
             wxLogLastError(wxT("InsertMenu"));
a807a11
         }
a807a11
@@ -1250,7 +1250,7 @@
a807a11
         }
a807a11
 #else
a807a11
         if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
a807a11
-                           (UINT)submenu, title) )
a807a11
+                           (intptr_t)submenu, title) )
a807a11
         {
a807a11
             wxLogLastError(wxT("AppendMenu"));
a807a11
         }
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/menuitem.cpp wxWidgets-2.8.12.patched/src/msw/menuitem.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/menuitem.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/menuitem.cpp	2011-04-07 12:37:02 +0800
a807a11
@@ -186,9 +186,14 @@
a807a11
 // ----
a807a11
 
a807a11
 // return the id for calling Win32 API functions
a807a11
-int wxMenuItem::GetRealId() const
a807a11
+WXWPARAM wxMenuItem::GetRealId() const
a807a11
 {
a807a11
-    return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();
a807a11
+    // we must use ids in unsigned short range with Windows functions, if we
a807a11
+    // pass ids > USHRT_MAX to them they get very confused (e.g. start
a807a11
+    // generating WM_COMMAND messages with negative high word of wParam), so
a807a11
+    // use the cast to ensure the id is in range
a807a11
+    return m_subMenu ? (intptr_t)m_subMenu->GetHMenu()
a807a11
+                     : static_cast<unsigned short>(GetId());
a807a11
 }
a807a11
 
a807a11
 // get item state
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/pen.cpp wxWidgets-2.8.12.patched/src/msw/pen.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/pen.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/pen.cpp	2011-04-07 12:47:35 +0800
a807a11
@@ -172,9 +172,9 @@
a807a11
            case wxSTIPPLE:
a807a11
                logb.lbStyle = BS_PATTERN ;
a807a11
                if (M_PENDATA->m_stipple.Ok())
a807a11
-                   logb.lbHatch = (LONG)M_PENDATA->m_stipple.GetHBITMAP();
a807a11
+                   logb.lbHatch = (intptr_t)M_PENDATA->m_stipple.GetHBITMAP();
a807a11
                else
a807a11
-                   logb.lbHatch = (LONG)0;
a807a11
+                   logb.lbHatch = (intptr_t)0;
a807a11
                break;
a807a11
            case wxBDIAGONAL_HATCH:
a807a11
                logb.lbStyle = BS_HATCHED;
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/printdlg.cpp wxWidgets-2.8.12.patched/src/msw/printdlg.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/printdlg.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/printdlg.cpp	2011-04-07 12:51:01 +0800
a807a11
@@ -175,10 +175,10 @@
a807a11
 
a807a11
 wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
a807a11
 {
a807a11
-    HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
a807a11
+    HGLOBAL hDevMode = (HGLOBAL) m_devMode;
a807a11
     if ( hDevMode )
a807a11
         GlobalFree(hDevMode);
a807a11
-    HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
a807a11
+    HGLOBAL hDevNames = (HGLOBAL) m_devNames;
a807a11
     if ( hDevNames )
a807a11
         GlobalFree(hDevNames);
a807a11
 }
a807a11
@@ -190,8 +190,8 @@
a807a11
 
a807a11
 bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
a807a11
 {
a807a11
-    HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
a807a11
-    HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
a807a11
+    HGLOBAL hDevMode = (HGLOBAL) m_devMode;
a807a11
+    HGLOBAL hDevNames = (HGLOBAL) m_devNames;
a807a11
 
a807a11
     if (!hDevMode)
a807a11
     {
a807a11
@@ -396,8 +396,8 @@
a807a11
 
a807a11
 bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
a807a11
 {
a807a11
-    HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
a807a11
-    HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
a807a11
+    HGLOBAL hDevMode = (HGLOBAL) m_devMode;
a807a11
+    HGLOBAL hDevNames = (HGLOBAL) m_devNames;
a807a11
     WinPrinter printer;
a807a11
     LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str();
a807a11
 
a807a11
@@ -493,7 +493,7 @@
a807a11
         else
a807a11
         {
a807a11
             hDevMode = pd.hDevMode;
a807a11
-            m_devMode = (void*)(long) hDevMode;
a807a11
+            m_devMode = (void*)(intptr_t) hDevMode;
a807a11
             pd.hDevMode = NULL;
a807a11
 
a807a11
             // We'll create a new DEVNAMEs structure below.
a807a11
@@ -502,7 +502,7 @@
a807a11
             pd.hDevNames = NULL;
a807a11
 
a807a11
             // hDevNames = pd->hDevNames;
a807a11
-            // m_devNames = (void*)(long) hDevNames;
a807a11
+            // m_devNames = (void*)(intptr_t) hDevNames;
a807a11
             // pd->hDevnames = NULL;
a807a11
 
a807a11
         }
a807a11
@@ -688,7 +688,7 @@
a807a11
     }
a807a11
 
a807a11
     // TODO: I hope it's OK to pass some empty strings to DEVNAMES.
a807a11
-    m_devNames = (void*) (long) wxCreateDevNames(wxEmptyString, data.GetPrinterName(), wxEmptyString);
a807a11
+    m_devNames = (void*) (intptr_t) wxCreateDevNames(wxEmptyString, data.GetPrinterName(), wxEmptyString);
a807a11
 
a807a11
     return true;
a807a11
 }
a807a11
@@ -820,13 +820,13 @@
a807a11
     if (pd->hDevNames)
a807a11
         GlobalFree(pd->hDevNames);
a807a11
 
a807a11
-    pd->hDevMode = (HGLOBAL)(DWORD) native_data->GetDevMode();
a807a11
+    pd->hDevMode = (HGLOBAL) native_data->GetDevMode();
a807a11
     native_data->SetDevMode( (void*) NULL);
a807a11
 
a807a11
     // Shouldn't assert; we should be able to test Ok-ness at a higher level
a807a11
     //wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
a807a11
 
a807a11
-    pd->hDevNames = (HGLOBAL)(DWORD) native_data->GetDevNames();
a807a11
+    pd->hDevNames = (HGLOBAL) native_data->GetDevNames();
a807a11
     native_data->SetDevNames( (void*) NULL);
a807a11
 
a807a11
 
a807a11
@@ -897,9 +897,9 @@
a807a11
         if (native_data->GetDevMode())
a807a11
         {
a807a11
             // Make sure we don't leak memory
a807a11
-            GlobalFree( (HGLOBAL)(DWORD) native_data->GetDevMode() );
a807a11
+            GlobalFree( (HGLOBAL) native_data->GetDevMode() );
a807a11
         }
a807a11
-        native_data->SetDevMode( (void*)(long) pd->hDevMode );
a807a11
+        native_data->SetDevMode( (void*)(intptr_t) pd->hDevMode );
a807a11
         pd->hDevMode = NULL;
a807a11
     }
a807a11
 
a807a11
@@ -909,9 +909,9 @@
a807a11
         if (native_data->GetDevNames())
a807a11
         {
a807a11
             // Make sure we don't leak memory
a807a11
-            GlobalFree((HGLOBAL)(DWORD) native_data->GetDevNames());
a807a11
+            GlobalFree((HGLOBAL) native_data->GetDevNames());
a807a11
         }
a807a11
-        native_data->SetDevNames((void*)(long) pd->hDevNames);
a807a11
+        native_data->SetDevNames((void*)(intptr_t) pd->hDevNames);
a807a11
         pd->hDevNames = NULL;
a807a11
     }
a807a11
 
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/tbar95.cpp wxWidgets-2.8.12.patched/src/msw/tbar95.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/tbar95.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/tbar95.cpp	2011-04-07 12:53:09 +0800
a807a11
@@ -802,8 +802,8 @@
a807a11
                 TBREPLACEBITMAP replaceBitmap;
a807a11
                 replaceBitmap.hInstOld = NULL;
a807a11
                 replaceBitmap.hInstNew = NULL;
a807a11
-                replaceBitmap.nIDOld = (UINT) oldToolBarBitmap;
a807a11
-                replaceBitmap.nIDNew = (UINT) hBitmap;
a807a11
+                replaceBitmap.nIDOld = (intptr_t) oldToolBarBitmap;
a807a11
+                replaceBitmap.nIDNew = (intptr_t) hBitmap;
a807a11
                 replaceBitmap.nButtons = nButtons;
a807a11
                 if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
a807a11
                                     0, (LPARAM) &replaceBitmap) )
a807a11
@@ -832,7 +832,7 @@
a807a11
         {
a807a11
             TBADDBITMAP addBitmap;
a807a11
             addBitmap.hInst = 0;
a807a11
-            addBitmap.nID = (UINT) hBitmap;
a807a11
+            addBitmap.nID = (intptr_t) hBitmap;
a807a11
             if ( ::SendMessage(GetHwnd(), TB_ADDBITMAP,
a807a11
                                (WPARAM) nButtons, (LPARAM)&addBitmap) == -1 )
a807a11
             {
a807a11
@@ -912,7 +912,7 @@
a807a11
                 {
a807a11
                     const wxString& label = tool->GetLabel();
a807a11
                     if ( !label.empty() )
a807a11
-                        button.iString = (int)label.c_str();
a807a11
+                        button.iString = (intptr_t)label.c_str();
a807a11
                 }
a807a11
 
a807a11
                 button.idCommand = tool->GetId();
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/textctrl.cpp wxWidgets-2.8.12.patched/src/msw/textctrl.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/textctrl.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/textctrl.cpp	2011-04-07 12:54:27 +0800
a807a11
@@ -960,7 +960,7 @@
a807a11
     // finally, stream it in the control
a807a11
     EDITSTREAM eds;
a807a11
     wxZeroMemory(eds);
a807a11
-    eds.dwCookie = (DWORD)&wpc;
a807a11
+    eds.dwCookie = (intptr_t)&wpc;
a807a11
     // the cast below is needed for broken (very) old mingw32 headers
a807a11
     eds.pfnCallback = (EDITSTREAMCALLBACK)wxRichEditStreamIn;
a807a11
 
a807a11
@@ -1013,7 +1013,7 @@
a807a11
 
a807a11
     EDITSTREAM eds;
a807a11
     wxZeroMemory(eds);
a807a11
-    eds.dwCookie = (DWORD)&dat;;
a807a11
+    eds.dwCookie = (intptr_t)&dat;;
a807a11
     eds.pfnCallback = wxRichEditStreamOut;
a807a11
 
a807a11
     ::SendMessage
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/thread.cpp wxWidgets-2.8.12.patched/src/msw/thread.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/thread.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/thread.cpp	2011-04-07 13:32:55 +0800
a807a11
@@ -522,7 +522,7 @@
a807a11
             return (THREAD_RETVAL)-1;
a807a11
         }
a807a11
 
a807a11
-        rc = (THREAD_RETVAL)thread->Entry();
a807a11
+        rc = (THREAD_RETVAL)(intptr_t)thread->Entry();
a807a11
     }
a807a11
     wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
a807a11
 
a807a11
@@ -842,7 +842,7 @@
a807a11
             break;
a807a11
         }
a807a11
 
a807a11
-        if ( (DWORD)rc != STILL_ACTIVE )
a807a11
+        if ( (intptr_t)rc != STILL_ACTIVE )
a807a11
             break;
a807a11
 
a807a11
         // give the other thread some time to terminate, otherwise we may be
a807a11
@@ -1000,7 +1000,7 @@
a807a11
     // could we set all bits?
a807a11
     if ( level != 0 )
a807a11
     {
a807a11
-        wxLogDebug(_T("bad level %u in wxThread::SetConcurrency()"), level);
a807a11
+        wxLogDebug(_T("bad level %Iu in wxThread::SetConcurrency()"), level);
a807a11
 
a807a11
         return false;
a807a11
     }
a807a11
@@ -1162,7 +1162,7 @@
a807a11
     }
a807a11
 
a807a11
 #ifdef wxUSE_BEGIN_THREAD
a807a11
-    _endthreadex((unsigned)status);
a807a11
+    _endthreadex((unsigned)(intptr_t)status);
a807a11
 #else // !VC++
a807a11
     ::ExitThread((DWORD)status);
a807a11
 #endif // VC++/!VC++
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/tooltip.cpp wxWidgets-2.8.12.patched/src/msw/tooltip.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/tooltip.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/tooltip.cpp	2011-04-07 13:12:26 +0800
a807a11
@@ -106,7 +106,7 @@
a807a11
             uFlags |= TTF_TRANSPARENT;
a807a11
         }
a807a11
 
a807a11
-        uId = (UINT)hwndOwner;
a807a11
+        uId = (intptr_t)hwndOwner;
a807a11
     }
a807a11
 };
a807a11
 
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/toplevel.cpp wxWidgets-2.8.12.patched/src/msw/toplevel.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/toplevel.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/toplevel.cpp	2011-04-07 13:13:54 +0800
a807a11
@@ -1122,7 +1122,7 @@
a807a11
     {
a807a11
         // restore focus to the child which was last focused unless we already
a807a11
         // have it
a807a11
-        wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
a807a11
+        wxLogTrace(_T("focus"), _T("wxTLW %p activated."), (intptr_t) m_hWnd);
a807a11
 
a807a11
         wxWindow *winFocus = FindFocus();
a807a11
         if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
a807a11
@@ -1157,9 +1157,9 @@
a807a11
         }
a807a11
 
a807a11
         wxLogTrace(_T("focus"),
a807a11
-                   _T("wxTLW %08x deactivated, last focused: %08x."),
a807a11
-                   (int) m_hWnd,
a807a11
-                   (int) (m_winLastFocused ? GetHwndOf(m_winLastFocused)
a807a11
+                   _T("wxTLW %p deactivated, last focused: %p."),
a807a11
+                   (intptr_t) m_hWnd,
a807a11
+                   (intptr_t) (m_winLastFocused ? GetHwndOf(m_winLastFocused)
a807a11
                                            : NULL));
a807a11
 
a807a11
         event.Skip();
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/utils.cpp wxWidgets-2.8.12.patched/src/msw/utils.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/utils.cpp	2011-03-22 20:00:54 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/utils.cpp	2011-04-07 13:14:32 +0800
a807a11
@@ -713,7 +713,7 @@
a807a11
         return -1;
a807a11
     }
a807a11
 
a807a11
-    wxON_BLOCK_EXIT1(::CloseHandle, hProcess);
a807a11
+    wxON_BLOCK_EXIT1((WINBOOL (*)(void *))::CloseHandle, hProcess);
a807a11
 
a807a11
     bool ok = true;
a807a11
     switch ( sig )
a807a11
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/window.cpp wxWidgets-2.8.12.patched/src/msw/window.cpp
a807a11
--- wxWidgets-2.8.12/src/msw/window.cpp	2011-03-22 20:00:55 +0800
a807a11
+++ wxWidgets-2.8.12.patched/src/msw/window.cpp	2011-04-07 13:17:11 +0800
a807a11
@@ -2596,8 +2596,8 @@
a807a11
     // trace all messages - useful for the debugging
a807a11
 #ifdef __WXDEBUG__
a807a11
     wxLogTrace(wxTraceMessages,
a807a11
-               wxT("Processing %s(hWnd=%08lx, wParam=%8lx, lParam=%8lx)"),
a807a11
-               wxGetMessageName(message), (long)hWnd, (long)wParam, lParam);
a807a11
+               wxT("Processing %s(hWnd=%Ix, wParam=%Ix, lParam=%Ix)"),
a807a11
+               wxGetMessageName(message), (intptr_t)hWnd, (intptr_t)wParam, (intptr_t)lParam);
a807a11
 #endif // __WXDEBUG__
a807a11
 
a807a11
     wxWindowMSW *wnd = wxFindWinFromHandle((WXHWND) hWnd);
a807a11
@@ -3438,7 +3438,7 @@
a807a11
 
a807a11
 wxWindow *wxFindWinFromHandle(WXHWND hWnd)
a807a11
 {
a807a11
-    return (wxWindow*)wxWinHandleHash->Get((long)hWnd);
a807a11
+    return (wxWindow*)wxWinHandleHash->Get((intptr_t)hWnd);
a807a11
 }
a807a11
 
a807a11
 void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win)
a807a11
@@ -3452,20 +3452,20 @@
a807a11
 #ifdef __WXDEBUG__
a807a11
     if ( oldWin && (oldWin != win) )
a807a11
     {
a807a11
-        wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
a807a11
-                   (int) hWnd, win->GetClassInfo()->GetClassName());
a807a11
+        wxLogDebug(wxT("HWND %IX already associated with another window (%s)"),
a807a11
+                   (intptr_t) hWnd, win->GetClassInfo()->GetClassName());
a807a11
     }
a807a11
     else
a807a11
 #endif // __WXDEBUG__
a807a11
     if (!oldWin)
a807a11
     {
a807a11
-        wxWinHandleHash->Put((long)hWnd, (wxWindow *)win);
a807a11
+        wxWinHandleHash->Put((intptr_t)hWnd, (wxWindow *)win);
a807a11
     }
a807a11
 }
a807a11
 
a807a11
 void wxRemoveHandleAssociation(wxWindowMSW *win)
a807a11
 {
a807a11
-    wxWinHandleHash->Delete((long)win->GetHWND());
a807a11
+    wxWinHandleHash->Delete((intptr_t)win->GetHWND());
a807a11
 }
a807a11
 
a807a11
 // ----------------------------------------------------------------------------