[REACTOS] Fix a number of Get/SetWindowsLong*Ptr* issues and use GWLP_* instead of...
[reactos.git] / sdk / include / psdk / windowsx.h
index fa7a0f5..530da54 100644 (file)
 #define GetWindowExStyle(hwnd) ((DWORD)GetWindowLong(hwnd,GWL_EXSTYLE))
 #define GetWindowFont(hwnd) FORWARD_WM_GETFONT((hwnd),SendMessage)
 #define GetWindowID(hwnd) GetDlgCtrlID(hwnd)
-#define GetWindowInstance(hwnd) ((HMODULE)GetWindowLong(hwnd,GWL_HINSTANCE))
+#define GetWindowInstance(hwnd) ((HMODULE)GetWindowLongPtr(hwnd,GWLP_HINSTANCE))
 #define GetWindowOwner(hwnd) GetWindow(hwnd,GW_OWNER)
 #define GetWindowStyle(hwnd) ((DWORD)GetWindowLong(hwnd,GWL_STYLE))
 #define GlobalAllocPtr(flags,cb) (GlobalLock(GlobalAlloc((flags),(cb))))
 #define Static_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
 #define Static_SetIcon(hwndCtl,hIcon) ((HICON)(UINT)(DWORD)SendMessage((hwndCtl),STM_SETICON,(WPARAM)(HICON)(hIcon),0))
 #define Static_SetText(hwndCtl,lpsz) SetWindowText((hwndCtl),(lpsz))
-#define SubclassDialog(hwndDlg,lpfn) ((DLGPROC)SetWindowLong(hwndDlg,DWL_DLGPROC,(LPARAM)(DLGPROC)(lpfn)))
-#define SubclassWindow(hwnd,lpfn) ((WNDPROC)SetWindowLong((hwnd),GWL_WNDPROC,(LPARAM)(WNDPROC)(lpfn)))
+#define SubclassDialog(hwndDlg,lpfn) ((DLGPROC)SetWindowLongPtr(hwndDlg,DWLP_DLGPROC,(LPARAM)(DLGPROC)(lpfn)))
+#define SubclassWindow(hwnd,lpfn) ((WNDPROC)SetWindowLongPtr((hwnd),GWLP_WNDPROC,(LPARAM)(WNDPROC)(lpfn)))
 #define SubtractRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_DIFF)
 #define UnionRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_OR)
 #define XorRgn(hrgnResult,hrgnA,hrgnB) CombineRgn(hrgnResult,hrgnA,hrgnB,RGN_XOR)