[REACTOS] Fix a number of Get/SetWindowsLong*Ptr* issues and use GWLP_* instead of GWL_* where appropriate.

This commit is contained in:
Timo Kreuzer 2018-02-05 02:42:14 +01:00
parent 173971d947
commit d281d14fd1
25 changed files with 118 additions and 118 deletions

View file

@ -74,17 +74,17 @@ WinMain(HINSTANCE hInstance,
printf("GetWindowTextA returned Ansi string \"%s\"\n", WindowTextA);
printf("\n");
SavedWndProcW = (WNDPROC) GetWindowLongW(hWnd, GWL_WNDPROC);
SavedWndProcW = (WNDPROC) GetWindowLongPtrW(hWnd, GWLP_WNDPROC);
printf("GetWindowLongW returned 0x%p\n", SavedWndProcW);
SavedWndProcA = (WNDPROC) GetWindowLongA(hWnd, GWL_WNDPROC);
SavedWndProcA = (WNDPROC) GetWindowLongPtrA(hWnd, GWLP_WNDPROC);
printf("GetWindowLongA returned 0x%p\n", SavedWndProcA);
printf("\n");
printf("Subclassing window using SetWindowLongW, new WndProc 0x%p\n", UnicodeSubclassProc);
SetWindowLongW(hWnd, GWL_WNDPROC, (LONG) UnicodeSubclassProc);
SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR) UnicodeSubclassProc);
printf("After subclass, IsWindowUnicode %s, WndProcA 0x%lx, WndProcW 0x%lx\n",
IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongA(hWnd, GWL_WNDPROC),
GetWindowLongW(hWnd, GWL_WNDPROC));
IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongPtrA(hWnd, GWLP_WNDPROC),
GetWindowLongPtrW(hWnd, GWLP_WNDPROC));
printf("Calling GetWindowTextW\n");
if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))
@ -96,10 +96,10 @@ WinMain(HINSTANCE hInstance,
printf("\n");
printf("Subclassing window using SetWindowLongA, new WndProc 0x%p\n", AnsiSubclassProc);
SetWindowLongA(hWnd, GWL_WNDPROC, (LONG) AnsiSubclassProc);
SetWindowLongPtrA(hWnd, GWLP_WNDPROC, (LONG_PTR) AnsiSubclassProc);
printf("After subclass, IsWindowUnicode %s, WndProcA 0x%lx, WndProcW 0x%lx\n",
IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongA(hWnd, GWL_WNDPROC),
GetWindowLongW(hWnd, GWL_WNDPROC));
IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongPtrA(hWnd, GWLP_WNDPROC),
GetWindowLongPtrW(hWnd, GWLP_WNDPROC));
printf("Calling GetWindowTextW\n");
if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))