diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 51404af089b..64fb1ebcd5e 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -1342,9 +1342,6 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, break; } - case WM_DESTROY: - PostQuitMessage(0); - break; } defwndproc_counter++; @@ -2682,7 +2679,6 @@ START_TEST(treeview) ULONG_PTR ctx_cookie; HANDLE hCtx; WNDCLASSA wc; - MSG msg; init_functions(); @@ -2760,11 +2756,4 @@ START_TEST(treeview) test_WM_GETDLGCODE(); unload_v6_module(ctx_cookie, hCtx); - - PostMessageA(hMainWnd, WM_CLOSE, 0, 0); - while(GetMessageA(&msg, 0, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessageA(&msg); - } } diff --git a/dlls/comctl32/tests/v6util.h b/dlls/comctl32/tests/v6util.h index b78290a50a0..626f6e61255 100644 --- a/dlls/comctl32/tests/v6util.h +++ b/dlls/comctl32/tests/v6util.h @@ -70,6 +70,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) { ACTCTX_SECTION_KEYED_DATA data; DWORD written; + HMODULE hmod; ACTCTXA ctx; HANDLE file; BOOL ret; @@ -103,6 +104,8 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) *hCtx = CreateActCtxA(&ctx); ok(*hCtx != 0, "Expected context handle\n"); + hmod = GetModuleHandleA("comctl32.dll"); + ret = ActivateActCtx(*hCtx, pcookie); ok(ret, "Failed to activate context, error %d.\n", GetLastError()); @@ -117,7 +120,10 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) "comctl32.dll", &data); ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError()); if (ret) + { + FreeLibrary(hmod); LoadLibraryA("comctl32.dll"); + } return ret; }