]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/private.h
part of SF patch #904166 (DMC fix)
[wxWidgets.git] / include / wx / msw / private.h
index 3d2bf3cb879804640352bde13e31b7a458ac7052..8337606c2257cf509d657edc12fcab292cbff5db 100644 (file)
@@ -461,6 +461,9 @@ private:
 #define GetHaccel()             ((HACCEL)GetHACCEL())
 #define GetHaccelOf(table)      ((HACCEL)((table).GetHACCEL()))
 
+#define GetHbrush()             ((HPEN)GetResourceHandle())
+#define GetHbrushOf(brush)      ((HPEN)(brush).GetResourceHandle())
+
 #define GetHmenu()              ((HMENU)GetHMenu())
 #define GetHmenuOf(menu)        ((HMENU)menu->GetHMenu())
 
@@ -473,6 +476,9 @@ private:
 #define GetHpalette()           ((HPALETTE)GetHPALETTE())
 #define GetHpaletteOf(pal)      ((HPALETTE)(pal).GetHPALETTE())
 
+#define GetHpen()               ((HPEN)GetResourceHandle())
+#define GetHpenOf(pen)          ((HPEN)(pen).GetResourceHandle())
+
 #define GetHrgn()               ((HRGN)GetHRGN())
 #define GetHrgnOf(rgn)          ((HRGN)(rgn).GetHRGN())
 
@@ -605,6 +611,57 @@ LocalFree (
 
 #endif
     // __WXWINCE__
+
+// ----------------------------------------------------------------------------
+// 32/64 bit helpers
+// ----------------------------------------------------------------------------
+
+#ifdef __WIN64__
+
+inline void *wxGetWindowProc(HWND hwnd)
+{
+    return (void *)::GetWindowLongPtr(hwnd, GWLP_WNDPROC);
+}
+
+inline void *wxGetWindowUserData(HWND hwnd)
+{
+    return (void *)::GetWindowLongPtr(hwnd, GWLP_USERDATA);
+}
+
+inline WNDPROC wxSetWindowProc(HWND hwnd, WNDPROC func)
+{
+    return (WNDPROC)::SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)func);
+}
+
+inline void *wxSetWindowUserData(HWND hwnd, void *data)
+{
+    return (void *)::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
+}
+
+#else // __WIN32__
+
+inline void *wxGetWindowProc(HWND hwnd)
+{
+    return (void *)::GetWindowLong(hwnd, GWL_WNDPROC);
+}
+
+inline void *wxGetWindowUserData(HWND hwnd)
+{
+    return (void *)::GetWindowLong(hwnd, GWL_USERDATA);
+}
+
+inline WNDPROC wxSetWindowProc(HWND hwnd, WNDPROC func)
+{
+    return (WNDPROC)::SetWindowLong(hwnd, GWL_WNDPROC, (LONG)func);
+}
+
+inline void *wxSetWindowUserData(HWND hwnd, void *data)
+{
+    return (void *)::SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
+}
+
+#endif // __WIN64__/__WIN32__
+
 #endif // wxUSE_GUI
 
 #endif