|
32 | 32 |
|
33 | 33 | static HWND hAnimateParentWnd, hAnimateWnd; |
34 | 34 | static const char animateTestClass[] = "AnimateTestClass"; |
35 | | -static WNDPROC animate_wndproc; |
36 | 35 | static HANDLE shell32; |
37 | 36 |
|
38 | 37 | /* try to make sure pending X events have been processed before continuing */ |
@@ -100,7 +99,7 @@ static void create_animate(DWORD parent_style, DWORD animate_style) |
100 | 99 | hAnimateWnd = CreateWindowExA(0, ANIMATE_CLASSA, NULL, WS_CHILD | WS_VISIBLE | animate_style, |
101 | 100 | 0, 0, rect.right, rect.bottom, hAnimateParentWnd, NULL, shell32, 0); |
102 | 101 | ok(hAnimateWnd != NULL, "failed to create parent wnd\n"); |
103 | | - animate_wndproc = (WNDPROC)SetWindowLongPtrA(hAnimateWnd, GWLP_WNDPROC, 0); |
| 102 | + SetWindowLongPtrA(hAnimateWnd, GWLP_WNDPROC, 0); |
104 | 103 |
|
105 | 104 | ShowWindow(hAnimateParentWnd, SW_SHOWNORMAL); |
106 | 105 | ok(GetUpdateRect(hAnimateParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n"); |
@@ -133,23 +132,40 @@ static void test_play(void) |
133 | 132 |
|
134 | 133 | create_animate(0, 0); |
135 | 134 | SetLastError(0xdeadbeef); |
136 | | - res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, (LPARAM)MAKEINTRESOURCE(INVALID_AVI_INDEX)); |
| 135 | + res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(INVALID_AVI_INDEX)); |
137 | 136 | err = GetLastError(); |
138 | 137 | ok(res == 0, "Invalid video should have failed\n"); |
139 | | - ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %u\n", err); |
| 138 | + ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %lu\n", err); |
140 | 139 |
|
141 | 140 | SetLastError(0xdeadbeef); |
142 | 141 | res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1)); |
143 | 142 | err = GetLastError(); |
144 | 143 | ok(res == 0, "Play should have failed\n"); |
145 | | - ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %u\n", err); |
| 144 | + ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", err); |
146 | 145 | destroy_animate(); |
147 | 146 |
|
148 | 147 | create_animate(0, 0); |
149 | | - res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, (LPARAM)MAKEINTRESOURCE(SEARCHING_AVI_INDEX)); |
| 148 | + res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(SEARCHING_AVI_INDEX)); |
150 | 149 | ok(res != 0, "Load AVI resource failed\n"); |
151 | 150 | res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1)); |
152 | 151 | ok(res != 0, "Play should have worked\n"); |
| 152 | + /* Test ACM_OPEN after playing an animation */ |
| 153 | + res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); |
| 154 | + ok(res == 0, "ACM_OPENA with a NULL lparam while playing should return 0\n"); |
| 155 | + destroy_animate(); |
| 156 | + |
| 157 | + /* Test ACM_OPEN after opening an animation */ |
| 158 | + create_animate(0, 0); |
| 159 | + res = SendMessageA(hAnimateWnd, ACM_OPENA, (WPARAM)shell32, MAKEINTRESOURCE(SEARCHING_AVI_INDEX)); |
| 160 | + ok(res != 0, "Load AVI resource failed\n"); |
| 161 | + res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); |
| 162 | + ok(res == 0, "ACM_OPENA with a NULL lparam should return 0\n"); |
| 163 | + destroy_animate(); |
| 164 | + |
| 165 | + /* Test ACM_OPEN without opening an animation */ |
| 166 | + create_animate(0, 0); |
| 167 | + res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); |
| 168 | + ok(res == 0, "ACM_OPENA with a NULL lparam should return 0\n"); |
153 | 169 | destroy_animate(); |
154 | 170 | } |
155 | 171 |
|
|
0 commit comments