diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index b192d4d6a9d..b3608684a60 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -234,7 +234,7 @@ static void test_subclass(void) ok_sequence(Sub_AfterDeletedTest, "After Deleted"); pSetWindowSubclass(hwnd, WndProcSub, 2, 0); - origProc3 = (WNDPROC)SetWindowLong(hwnd, GWL_WNDPROC, (LONG)WndProc3); + origProc3 = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG)WndProc3); SendMessage(hwnd, WM_USER, 1, 0); SendMessage(hwnd, WM_USER, 2, 0); ok_sequence(Sub_OldAfterNewTest, "Old after New"); diff --git a/dlls/gdi/tests/bitmap.c b/dlls/gdi/tests/bitmap.c index dbbb81b8068..b8118025928 100644 --- a/dlls/gdi/tests/bitmap.c +++ b/dlls/gdi/tests/bitmap.c @@ -451,7 +451,7 @@ START_TEST(bitmap) 10, 10, 300, 300, NULL, NULL, NULL, NULL); assert(hWnd); - is_win9x = GetWindowLongW(hWnd, GWL_WNDPROC) == 0; + is_win9x = GetWindowLongPtrW(hWnd, GWLP_WNDPROC) == 0; DestroyWindow(hWnd); test_createdibitmap(); diff --git a/dlls/user/tests/class.c b/dlls/user/tests/class.c index 250b6b6f407..f59f02587d5 100644 --- a/dlls/user/tests/class.c +++ b/dlls/user/tests/class.c @@ -251,9 +251,9 @@ static void check_instance( const char *name, HINSTANCE inst, HINSTANCE info_ins ok( (HINSTANCE)GetClassLongA( hwnd, GCL_HMODULE ) == gcl_inst, "Wrong GCL instance %p/%p for class %s\n", (HINSTANCE)GetClassLongA( hwnd, GCL_HMODULE ), gcl_inst, name ); - ok( (HINSTANCE)GetWindowLongA( hwnd, GWL_HINSTANCE ) == inst, + ok( (HINSTANCE)GetWindowLongPtrA( hwnd, GWLP_HINSTANCE ) == inst, "Wrong GWL instance %p/%p for window %s\n", - (HINSTANCE)GetWindowLongA( hwnd, GWL_HINSTANCE ), inst, name ); + (HINSTANCE)GetWindowLongPtrA( hwnd, GWLP_HINSTANCE ), inst, name ); ok(!UnregisterClassA(name, inst), "UnregisterClassA should fail while exists a class window\n"); ok(GetLastError() == ERROR_CLASS_HAS_WINDOWS, "GetLastError() should be set to ERROR_CLASS_HAS_WINDOWS not %ld\n", GetLastError()); DestroyWindow(hwnd); diff --git a/dlls/user/tests/menu.c b/dlls/user/tests/menu.c index ef97bf87035..1c1d5b0531f 100644 --- a/dlls/user/tests/menu.c +++ b/dlls/user/tests/menu.c @@ -172,7 +172,7 @@ static void test_menu_ownerdraw(void) NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError()); if( !hwnd) return; - SetWindowLong( hwnd, GWL_WNDPROC, (LONG)menu_ownerdraw_wnd_proc); + SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG)menu_ownerdraw_wnd_proc); hmenu = CreatePopupMenu(); ok(hmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError()); if( !hmenu) { DestroyWindow(hwnd);return;} diff --git a/dlls/user/tests/msg.c b/dlls/user/tests/msg.c index f467e6960b5..00e1679d9fa 100644 --- a/dlls/user/tests/msg.c +++ b/dlls/user/tests/msg.c @@ -4468,7 +4468,7 @@ static LRESULT WINAPI MsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPAR { DWORD style = GetWindowLongA(hwnd, GWL_STYLE); if (style & WS_CHILD) - lParam = GetWindowLongA(hwnd, GWL_ID); + lParam = GetWindowLongPtrA(hwnd, GWLP_ID); else if (style & WS_POPUP) lParam = WND_POPUP_ID; else @@ -4497,7 +4497,7 @@ static LRESULT WINAPI MsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPAR { DWORD style = GetWindowLongA(hwnd, GWL_STYLE); if (style & WS_CHILD) - lParam = GetWindowLongA(hwnd, GWL_ID); + lParam = GetWindowLongPtrA(hwnd, GWLP_ID); else if (style & WS_POPUP) lParam = WND_POPUP_ID; else @@ -4788,7 +4788,7 @@ static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam) { DWORD style = GetWindowLongA((HWND)wParam, GWL_STYLE); if (style & WS_CHILD) - lParam = GetWindowLongA((HWND)wParam, GWL_ID); + lParam = GetWindowLongPtrA((HWND)wParam, GWLP_ID); else if (style & WS_POPUP) lParam = WND_POPUP_ID; else @@ -5743,7 +5743,7 @@ static void test_DispatchMessage(void) UpdateWindow( hwnd ); while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); flush_sequence(); - SetWindowLongPtrA( hwnd, GWL_WNDPROC, (LONG_PTR)DispatchMessageCheckProc ); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)DispatchMessageCheckProc ); SetRect( &rect, -5, -5, 5, 5 ); RedrawWindow( hwnd, &rect, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME ); diff --git a/dlls/user/tests/win.c b/dlls/user/tests/win.c index 41cc1cf794e..19fbef5ada8 100644 --- a/dlls/user/tests/win.c +++ b/dlls/user/tests/win.c @@ -71,7 +71,7 @@ static void check_parents( HWND hwnd, HWND ga_parent, HWND gwl_parent, HWND get_ res = pGetAncestor( hwnd, GA_PARENT ); ok( res == ga_parent, "Wrong result for GA_PARENT %p expected %p\n", res, ga_parent ); } - res = (HWND)GetWindowLongA( hwnd, GWL_HWNDPARENT ); + res = (HWND)GetWindowLongPtrA( hwnd, GWLP_HWNDPARENT ); ok( res == gwl_parent, "Wrong result for GWL_HWNDPARENT %p expected %p\n", res, gwl_parent ); res = GetParent( hwnd ); ok( res == get_parent, "Wrong result for GetParent %p expected %p\n", res, get_parent ); @@ -300,24 +300,24 @@ static void test_parent_owner(void) test = create_tool_window( WS_CHILD, hwndMain ); trace( "created child %p\n", test ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)hwndMain2 ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)hwndMain2 ); ok( ret == hwndMain, "GWL_HWNDPARENT return value %p expected %p\n", ret, hwndMain ); check_parents( test, hwndMain2, hwndMain2, hwndMain2, 0, hwndMain2, hwndMain2 ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)child ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)child ); ok( ret == hwndMain2, "GWL_HWNDPARENT return value %p expected %p\n", ret, hwndMain2 ); check_parents( test, child, child, child, 0, hwndMain, hwndMain ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)desktop ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)desktop ); ok( ret == child, "GWL_HWNDPARENT return value %p expected %p\n", ret, child ); check_parents( test, desktop, 0, desktop, 0, test, desktop ); - /* window is now child of desktop so GWL_HWNDPARENT changes owner from now on */ - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)child ); + /* window is now child of desktop so GWLP_HWNDPARENT changes owner from now on */ + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)child ); ok( ret == 0, "GWL_HWNDPARENT return value %p expected 0\n", ret ); check_parents( test, desktop, child, desktop, child, test, desktop ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, 0 ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, 0 ); ok( ret == child, "GWL_HWNDPARENT return value %p expected %p\n", ret, child ); check_parents( test, desktop, 0, desktop, 0, test, desktop ); DestroyWindow( test ); @@ -326,15 +326,15 @@ static void test_parent_owner(void) test = create_tool_window( 0, 0 ); trace( "created top-level %p\n", test ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)hwndMain2 ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)hwndMain2 ); ok( ret == 0, "GWL_HWNDPARENT return value %p expected 0\n", ret ); check_parents( test, desktop, hwndMain2, 0, hwndMain2, test, test ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)child ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)child ); ok( ret == hwndMain2, "GWL_HWNDPARENT return value %p expected %p\n", ret, hwndMain2 ); check_parents( test, desktop, child, 0, child, test, test ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, 0 ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, 0 ); ok( ret == child, "GWL_HWNDPARENT return value %p expected %p\n", ret, child ); check_parents( test, desktop, 0, 0, 0, test, test ); DestroyWindow( test ); @@ -343,15 +343,15 @@ static void test_parent_owner(void) test = create_tool_window( WS_POPUP, 0 ); trace( "created popup %p\n", test ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)hwndMain2 ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)hwndMain2 ); ok( ret == 0, "GWL_HWNDPARENT return value %p expected 0\n", ret ); check_parents( test, desktop, hwndMain2, hwndMain2, hwndMain2, test, hwndMain2 ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (LONG_PTR)child ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (LONG_PTR)child ); ok( ret == hwndMain2, "GWL_HWNDPARENT return value %p expected %p\n", ret, hwndMain2 ); check_parents( test, desktop, child, child, child, test, hwndMain ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, 0 ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, 0 ); ok( ret == child, "GWL_HWNDPARENT return value %p expected %p\n", ret, child ); check_parents( test, desktop, 0, 0, 0, test, test ); DestroyWindow( test ); @@ -390,7 +390,7 @@ static void test_parent_owner(void) ok( ret == desktop, "SetParent return value %p expected %p\n", ret, desktop ); check_parents( test, child, child, hwndMain2, hwndMain2, hwndMain, hwndMain2 ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (ULONG_PTR)hwndMain ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (ULONG_PTR)hwndMain ); ok( ret == child, "GWL_HWNDPARENT return value %p expected %p\n", ret, child ); check_parents( test, hwndMain, hwndMain, hwndMain2, hwndMain2, hwndMain, hwndMain2 ); DestroyWindow( test ); @@ -426,7 +426,7 @@ static void test_parent_owner(void) owner = create_tool_window( WS_CHILD, hwndMain2 ); test = create_tool_window( WS_POPUP, 0 ); trace( "created owner %p and popup %p\n", owner, test ); - ret = (HWND)SetWindowLongA( test, GWL_HWNDPARENT, (ULONG_PTR)owner ); + ret = (HWND)SetWindowLongPtrA( test, GWLP_HWNDPARENT, (ULONG_PTR)owner ); ok( ret == 0, "GWL_HWNDPARENT return value %p expected 0\n", ret ); check_parents( test, desktop, owner, owner, owner, test, hwndMain2 ); DestroyWindow( owner ); @@ -459,7 +459,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR minmax->ptMaxPosition.x, minmax->ptMaxPosition.y, minmax->ptMinTrackSize.x, minmax->ptMinTrackSize.y, minmax->ptMaxTrackSize.x, minmax->ptMaxTrackSize.y); - SetWindowLongA(hwnd, GWL_USERDATA, 0x20031021); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0x20031021); break; } case WM_WINDOWPOSCHANGING: @@ -516,7 +516,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR } case WM_NCCREATE: { - BOOL got_getminmaxinfo = GetWindowLongA(hwnd, GWL_USERDATA) == 0x20031021; + BOOL got_getminmaxinfo = GetWindowLongPtrA(hwnd, GWLP_USERDATA) == 0x20031021; CREATESTRUCTA *cs = (CREATESTRUCTA *)lparam; trace("WM_NCCREATE: hwnd %p, parent %p, style %08lx\n", hwnd, cs->hwndParent, cs->style); @@ -554,12 +554,12 @@ static LRESULT WINAPI tool_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR minmax->ptMaxPosition.x, minmax->ptMaxPosition.y, minmax->ptMinTrackSize.x, minmax->ptMinTrackSize.y, minmax->ptMaxTrackSize.x, minmax->ptMaxTrackSize.y); - SetWindowLongA(hwnd, GWL_USERDATA, 0x20031021); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0x20031021); break; } case WM_NCCREATE: { - BOOL got_getminmaxinfo = GetWindowLongA(hwnd, GWL_USERDATA) == 0x20031021; + BOOL got_getminmaxinfo = GetWindowLongPtrA(hwnd, GWLP_USERDATA) == 0x20031021; CREATESTRUCTA *cs = (CREATESTRUCTA *)lparam; trace("WM_NCCREATE: hwnd %p, parent %p, style %08lx\n", hwnd, cs->hwndParent, cs->style); @@ -670,7 +670,7 @@ static void test_nonclient_area(HWND hwnd) DWORD style, exstyle; RECT rc_window, rc_client, rc; BOOL menu; - BOOL is_win9x = GetWindowLongW(hwnd, GWL_WNDPROC) == 0; + BOOL is_win9x = GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == 0; style = GetWindowLongA(hwnd, GWL_STYLE); exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE); @@ -973,14 +973,14 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_cs.lParam = (LPARAM)mdi_lParam_test_message; mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); mdi_cs.style = 0x7fffffff; /* without WS_POPUP */ mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -993,7 +993,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) else { ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1014,7 +1014,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) } else { - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1026,7 +1026,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, GetModuleHandle(0), (LPARAM)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1037,7 +1037,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, GetModuleHandle(0), (LPARAM)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1054,7 +1054,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) else { ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1076,7 +1076,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) } else { - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1088,7 +1088,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1099,7 +1099,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1116,7 +1116,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) else { ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1138,7 +1138,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) } else { - ok(GetWindowLongA(mdi_child, GWL_ID) == first_id, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == first_id, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1162,7 +1162,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == 0, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == 0, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); DestroyWindow(mdi_child); mdi_child = CreateWindowExA(0, "MDI_child_Class_2", "MDI child", @@ -1172,7 +1172,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == 0, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == 0, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); DestroyWindow(mdi_child); /* maximized child */ @@ -1183,7 +1183,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == 0, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == 0, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); DestroyWindow(mdi_child); trace("Creating maximized child with a caption\n"); @@ -1194,7 +1194,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == 0, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == 0, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); DestroyWindow(mdi_child); trace("Creating maximized child with a caption and a thick frame\n"); @@ -1205,7 +1205,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT first_id) mdi_client, 0, GetModuleHandle(0), (LPVOID)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); - ok(GetWindowLongA(mdi_child, GWL_ID) == 0, "wrong child id %ld\n", GetWindowLongA(mdi_child, GWL_ID)); + ok(GetWindowLongPtrA(mdi_child, GWLP_ID) == 0, "wrong child id %ld\n", GetWindowLongPtrA(mdi_child, GWLP_ID)); DestroyWindow(mdi_child); } @@ -3017,7 +3017,7 @@ static LRESULT WINAPI parentdc_window_procA(HWND hwnd, UINT msg, WPARAM wparam, RECT rc; PAINTSTRUCT ps; - struct parentdc_stat *t = (struct parentdc_stat *)GetWindowLongPtrA(hwnd, GWL_USERDATA); + struct parentdc_stat *t = (struct parentdc_stat *)GetWindowLongPtrA(hwnd, GWLP_USERDATA); switch (msg) { @@ -3175,13 +3175,13 @@ static void test_csparentdc(void) AdjustWindowRectEx(&rc, WS_OVERLAPPEDWINDOW, FALSE, 0); hwndMain = CreateWindowA("ParentDcMainWindowClass", "Main Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, 0, NULL); - SetWindowLongPtrA(hwndMain, GWL_USERDATA, (DWORD_PTR)&test_answer.main); + SetWindowLongPtrA(hwndMain, GWLP_USERDATA, (DWORD_PTR)&test_answer.main); hwnd1 = CreateWindowA("ParentDcWindowClass", "Child Window 1", WS_CHILD, 20, 20, 40, 40, hwndMain, NULL, 0, NULL); - SetWindowLongPtrA(hwnd1, GWL_USERDATA, (DWORD_PTR)&test_answer.child1); + SetWindowLongPtrA(hwnd1, GWLP_USERDATA, (DWORD_PTR)&test_answer.child1); hwnd2 = CreateWindowA("ParentDcWindowClass", "Child Window 2", WS_CHILD, 40, 40, 40, 40, hwndMain, NULL, 0, NULL); - SetWindowLongPtrA(hwnd2, GWL_USERDATA, (DWORD_PTR)&test_answer.child2); + SetWindowLongPtrA(hwnd2, GWLP_USERDATA, (DWORD_PTR)&test_answer.child2); ShowWindow(hwndMain, SW_SHOW); ShowWindow(hwnd1, SW_SHOW); ShowWindow(hwnd2, SW_SHOW); diff --git a/programs/taskmgr/graph.c b/programs/taskmgr/graph.c index 4db1d8756dc..708ec8fe73c 100644 --- a/programs/taskmgr/graph.c +++ b/programs/taskmgr/graph.c @@ -115,7 +115,7 @@ LRESULT CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP hdc = BeginPaint(hWnd, &ps); - WindowId = GetWindowLong(hWnd, GWL_ID); + WindowId = GetWindowLongPtr(hWnd, GWLP_ID); switch (WindowId) { diff --git a/programs/taskmgr/perfpage.c b/programs/taskmgr/perfpage.c index 3c0a770e5ce..a30aacf12ce 100644 --- a/programs/taskmgr/perfpage.c +++ b/programs/taskmgr/perfpage.c @@ -196,10 +196,10 @@ LRESULT CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, /* * Subclass graph buttons */ - OldGraphWndProc = SetWindowLong(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG)Graph_WndProc); - SetWindowLong(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG)Graph_WndProc); - OldGraphCtrlWndProc = SetWindowLong(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc); - SetWindowLong(hPerformancePageCpuUsageHistoryGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc); + OldGraphWndProc = SetWindowLongPtr(hPerformancePageCpuUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc); + SetWindowLongPtr(hPerformancePageMemUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc); + OldGraphCtrlWndProc = SetWindowLongPtr(hPerformancePageMemUsageHistoryGraph, GWLP_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); + SetWindowLongPtr(hPerformancePageCpuUsageHistoryGraph, GWLP_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); return TRUE; case WM_COMMAND: diff --git a/programs/taskmgr/procpage.c b/programs/taskmgr/procpage.c index e2f1cc82e75..20886034530 100644 --- a/programs/taskmgr/procpage.c +++ b/programs/taskmgr/procpage.c @@ -91,7 +91,7 @@ LRESULT CALLBACK ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPAR /* * Subclass the process list control so we can intercept WM_ERASEBKGND */ - OldProcessListWndProc = SetWindowLong(hProcessPageListCtrl, GWL_WNDPROC, (LONG)ProcessListWndProc); + OldProcessListWndProc = SetWindowLongPtr(hProcessPageListCtrl, GWLP_WNDPROC, (LONG_PTR)ProcessListWndProc); /* Start our refresh thread */ CreateThread(NULL, 0, ProcessPageRefreshThread, NULL, 0, NULL); diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c index c292cb88223..3e4abb4cc3e 100644 --- a/programs/wineconsole/dialog.c +++ b/programs/wineconsole/dialog.c @@ -65,7 +65,7 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR case WM_INITDIALOG: di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam; di->hDlg = hDlg; - SetWindowLong(hDlg, DWL_USER, (DWORD)di); + SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)di); if (di->config.cursor_size <= 25) idc = IDC_OPT_CURSOR_SMALL; else if (di->config.cursor_size <= 50) idc = IDC_OPT_CURSOR_MEDIUM; @@ -89,7 +89,7 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR DWORD val; BOOL done; - di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); + di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER); switch (nmhdr->code) { @@ -176,7 +176,7 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam, struct dialog_info* di; HFONT hFont, hOldFont; - di = (struct dialog_info*)GetWindowLong(GetParent(hWnd), DWL_USER); + di = (struct dialog_info*)GetWindowLongPtr(GetParent(hWnd), DWLP_USER); BeginPaint(hWnd, &ps); font_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L); @@ -520,7 +520,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case WM_INITDIALOG: di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam; di->hDlg = hDlg; - SetWindowLong(hDlg, DWL_USER, (DWORD)di); + SetWindowLongPtr(hDlg, DWLP_USER, (DWORD_PTR)di); /* remove dialog from this control, font will be reset when listboxes are filled */ SendDlgItemMessage(hDlg, IDC_FNT_PREVIEW, WM_SETFONT, 0L, 0L); fill_list_font(di); @@ -528,7 +528,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM SetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0, di->config.def_attr & 0x0F); break; case WM_COMMAND: - di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); + di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER); switch (LOWORD(wParam)) { case IDC_FNT_LIST_FONT: @@ -550,7 +550,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM NMHDR* nmhdr = (NMHDR*)lParam; DWORD val; - di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); + di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER); switch (nmhdr->code) { case PSN_SETACTIVE: @@ -600,7 +600,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR case WM_INITDIALOG: di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam; di->hDlg = hDlg; - SetWindowLong(hDlg, DWL_USER, (DWORD)di); + SetWindowLongPtr(hDlg, DWLP_USER, (DWORD_PTR)di); SetDlgItemInt(hDlg, IDC_CNF_SB_WIDTH, di->config.sb_width, FALSE); SetDlgItemInt(hDlg, IDC_CNF_SB_HEIGHT, di->config.sb_height, FALSE); SetDlgItemInt(hDlg, IDC_CNF_WIN_WIDTH, di->config.win_width, FALSE); @@ -621,7 +621,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR break; case WM_COMMAND: - di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); + di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER); switch (LOWORD(wParam)) { } @@ -632,7 +632,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR int win_w, win_h, sb_w, sb_h; BOOL st1, st2; - di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); + di = (struct dialog_info*)GetWindowLongPtr(hDlg, DWLP_USER); switch (nmhdr->code) { case PSN_SETACTIVE: diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index f815359fc5a..b9963a45fe5 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -1417,7 +1417,7 @@ static void packet_query_monitor_wnd_helper(struct gdb_context* gdbctx, HWND hWn "%*s%04x%*s%-17.17s %08lx %08lx %.14s\n", indent, "", (UINT)hWnd, 13 - indent, "", clsName, GetWindowLong(hWnd, GWL_STYLE), - GetWindowLong(hWnd, GWL_WNDPROC), wndName); + GetWindowLongPtr(hWnd, GWLP_WNDPROC), wndName); packet_reply_hex_to_str(gdbctx, buffer); packet_reply_close(gdbctx); diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c index db589d3619d..e475eff6c0b 100644 --- a/programs/winedbg/info.c +++ b/programs/winedbg/info.c @@ -305,7 +305,7 @@ static void class_walker(HWND hWnd, struct class_walker* cw) void info_win32_class(HWND hWnd, const char* name) { WNDCLASSEXA wca; - HINSTANCE hInst = hWnd ? (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE) : 0; + HINSTANCE hInst = hWnd ? (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE) : 0; if (!name) { @@ -369,7 +369,7 @@ static void info_window(HWND hWnd, int indent) dbg_printf("%*s%08x%*s %-17.17s %08lx %08lx %08lx %.14s\n", indent, "", (UINT)hWnd, 12 - indent, "", clsName, GetWindowLong(hWnd, GWL_STYLE), - GetWindowLong(hWnd, GWL_WNDPROC), + GetWindowLongPtr(hWnd, GWLP_WNDPROC), GetWindowThreadProcessId(hWnd, NULL), wndName); if ((child = GetWindow(hWnd, GW_CHILD)) != 0) @@ -416,12 +416,12 @@ void info_win32_window(HWND hWnd, BOOL detailed) GetParent(hWnd), GetWindow(hWnd, GW_OWNER), clsName, - (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE), + (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE), GetLastActivePopup(hWnd), - GetWindowLong(hWnd, GWL_ID), + GetWindowLongPtr(hWnd, GWLP_ID), GetWindowLong(hWnd, GWL_STYLE), GetWindowLong(hWnd, GWL_EXSTYLE), - GetWindowLong(hWnd, GWL_WNDPROC), + GetWindowLongPtr(hWnd, GWLP_WNDPROC), wndName, clientRect.left, clientRect.top, clientRect.right, clientRect.bottom, windowRect.left, windowRect.top, windowRect.right, windowRect.bottom, diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index 0f6ed1914c2..c1a7bfcde29 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -1616,7 +1616,7 @@ static LRESULT CALLBACK CBTProc(int code, WPARAM wparam, LPARAM lparam) newchild = NULL; child->hwnd = (HWND) wparam; - SetWindowLong(child->hwnd, GWL_USERDATA, (LPARAM)child); + SetWindowLongPtr(child->hwnd, GWLP_USERDATA, (LPARAM)child); } return CallNextHookEx(hcbthook, code, wparam, lparam); @@ -1696,7 +1696,7 @@ static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, switch(nmsg) { case WM_INITDIALOG: - SetWindowLong(hwnd, GWL_USERDATA, lparam); + SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam); SetWindowText(GetDlgItem(hwnd, 201), (LPCTSTR)lparam); return 1; @@ -1705,7 +1705,7 @@ static INT_PTR CALLBACK DestinationDlgProc(HWND hwnd, UINT nmsg, WPARAM wparam, switch(id) { case IDOK: { - LPTSTR dest = (LPTSTR) GetWindowLong(hwnd, GWL_USERDATA); + LPTSTR dest = (LPTSTR) GetWindowLongPtr(hwnd, GWLP_USERDATA); GetWindowText(GetDlgItem(hwnd, 201), dest, MAX_PATH); EndDialog(hwnd, id); break;} @@ -2083,7 +2083,7 @@ static BOOL activate_drive_window(LPCTSTR path) /* search for a already open window for the same drive */ for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) { - ChildWnd* child = (ChildWnd*) GetWindowLong(child_wnd, GWL_USERDATA); + ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA); if (child) { _tsplitpath(child->root.path, drv2, 0, 0, 0); @@ -2108,7 +2108,7 @@ static BOOL activate_fs_window(LPCTSTR filesys) /* search for a already open window of the given file system name */ for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) { - ChildWnd* child = (ChildWnd*) GetWindowLong(child_wnd, GWL_USERDATA); + ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA); if (child) { if (!lstrcmpi(child->root.fs, filesys)) { @@ -2253,7 +2253,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM /* change font in all open child windows */ for(childWnd=GetWindow(Globals.hmdiclient,GW_CHILD); childWnd; childWnd=GetNextWindow(childWnd,GW_HWNDNEXT)) { - ChildWnd* child = (ChildWnd*) GetWindowLong(childWnd, GWL_USERDATA); + ChildWnd* child = (ChildWnd*) GetWindowLongPtr(childWnd, GWLP_USERDATA); SetWindowFont(child->left.hwnd, Globals.hfont, TRUE); SetWindowFont(child->right.hwnd, Globals.hfont, TRUE); ListBox_SetItemHeight(child->left.hwnd, 1, max(Globals.spaceSize.cy,IMAGE_HEIGHT+3)); @@ -2860,7 +2860,7 @@ static void create_tree_window(HWND parent, Pane* pane, int id, int id_header, L LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY, 0, 0, 0, 0, parent, (HMENU)id, Globals.hInstance, 0); - SetWindowLong(pane->hwnd, GWL_USERDATA, (LPARAM)pane); + SetWindowLongPtr(pane->hwnd, GWLP_USERDATA, (LPARAM)pane); g_orgTreeWndProc = SubclassWindow(pane->hwnd, TreeWndProc); SetWindowFont(pane->hwnd, Globals.hfont, FALSE); @@ -4142,7 +4142,7 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) { - ChildWnd* child = (ChildWnd*) GetWindowLong(hwnd, GWL_USERDATA); + ChildWnd* child = (ChildWnd*) GetWindowLongPtr(hwnd, GWLP_USERDATA); ASSERT(child); switch(nmsg) { @@ -4165,7 +4165,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM case WM_NCDESTROY: free_child_window(child); - SetWindowLong(hwnd, GWL_USERDATA, 0); + SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); break; case WM_PAINT: { @@ -4524,8 +4524,8 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM static LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) { - ChildWnd* child = (ChildWnd*) GetWindowLong(GetParent(hwnd), GWL_USERDATA); - Pane* pane = (Pane*) GetWindowLong(hwnd, GWL_USERDATA); + ChildWnd* child = (ChildWnd*) GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); + Pane* pane = (Pane*) GetWindowLongPtr(hwnd, GWLP_USERDATA); ASSERT(child); switch(nmsg) { diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 930ab0950c5..5c4b9e21604 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -763,8 +763,8 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa Globals.hInstance, 0); if (button->hWnd) { if (Globals.button_proc == NULL) - Globals.button_proc = (WNDPROC) GetWindowLong(button->hWnd, GWL_WNDPROC); - SetWindowLong(button->hWnd, GWL_WNDPROC, (LONG) WINHELP_ButtonWndProc); + Globals.button_proc = (WNDPROC) GetWindowLongPtr(button->hWnd, GWLP_WNDPROC); + SetWindowLongPtr(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); } } hDc = GetDC(button->hWnd);